Project1

标题: VX如何下载文件? [打印本页]

作者: 张咚咚    时间: 2013-9-11 13:51
标题: VX如何下载文件?
VX如何下载文件?(比如*.png,*.txt,*..rvdata )
求大神指教!
作者: 铃仙·优昙华院·因幡    时间: 2013-9-11 14:36
RUBY 代码复制
  1. module RmNet
  2.  
  3.   URLDownloadToFile = Win32API.new( "urlmon.dll", "URLDownloadToFile", "ppplp", "i" )
  4.  
  5.   def  self.dowmload( url, name )
  6.     URLDownloadToFile.call(0, url, name, 0, 0)
  7.   end
  8.  
  9. end
  10.  
  11. RmNet.dowmload("http://attach.66rpg.com/bbs/attachment/forum/201309/11/135316u8scuuuu8ys0lsuu.jpg", "1.jpg")

作者: 张咚咚    时间: 2013-9-11 15:09
铃仙·优昙华院·因幡 发表于 2013-9-11 14:36
module RmNet
  
  URLDownloadToFile = Win32API.new( "urlmon.dll", "URLDownloadToFile", "ppplp", "i"  ...

太谢谢拉!
作者: 铃仙·优昙华院·因幡    时间: 2013-9-11 15:14
本帖最后由 铃仙·优昙华院·因幡 于 2013-9-11 15:16 编辑

用这个函数有点问题就是, 下载较大文件的时候, 容易出现假死现象, 虽然程序没死, 不过体验不太好.

可以给下载提供一个回调查询方法, 可以用来显示下载进度什么的, 只是咱没写.

其实也可以用来替换我之前给的那个 dll 里的方法.
作者: 张咚咚    时间: 2013-9-11 15:22
本帖最后由 张咚咚 于 2013-9-11 15:23 编辑

奥, 对了,就是比如我要是弄一个进度条,我在脚本的第一行"▼ 模块"里写上
$game_map.screen.pictures[1].show("进度条", 0, 210, 48, 100, 100, 255, 0)
为什么会出错啊..
加上
def aaa
$game_map.screen.pictures[1].show("进度条", 0, 210, 48, 100, 100, 255, 0)
end
就不管用了,这是什么原因啊...




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1