[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
回复 126# codegay


    这样不用开浏览器 不卡

TOP

回复 126# codegay


    恭喜你才对了
之前我改成了666666

TOP

回复 125# bbaa


    一定是你作弊刚好被我看到了。
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

本帖最后由 bbaa 于 2017-7-22 16:45 编辑

回复 124# codegay


    ?admin 滑稽
开个玩笑....

TOP

what ?
  1. bbaa:1701+79    79/min
复制代码
去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

本帖最后由 bbaa 于 2017-7-22 13:11 编辑

回复 121# 523066680


    今晚出去玩,现在才完成收集
部分代码公布....
发现代码有疏漏,导致无法构成数组现以修复
  1. /* 如果在主项中已经没有这个用户,在数据中删除掉 End*/
  2. foreach($json["Username"] as $key=>$value) {
  3. If (time()-(int)$dataqx[$key]["Timestamp"]>=300) {
  4. $dataqx[$key]["Timestamp"]=time();
  5. if((int)Count($dataqx[$key]["data"])<12) {
  6. $dataqx[$key]["data"][Count($dataqx[$key]["data"])]=$value["Count"];
  7. } else {
  8. /* 对于data满12的一个处理 {*/
  9. $temp=Array(); //对foreach的处理机制做出应对
  10. foreach ($dataqx[$key]["data"] as $keyt=>$val) {
  11. if ((int)$keyt>0&&(int)$keyt<=12) {
  12. $temp[$key]["data"][Count($temp[$key]["data"])]=$val;
  13. }
  14. }
  15. Unset($dataqx[$key]["data"]);
  16. $dataqx[$key]["data"]=$temp[$key]["data"]; //合并
  17. Unset($temp);
  18. /* 对于data满12的一个处理 }*/
  19. //$dataqx[$key]["data"][Count($dataqx[$key]["data"])]=$value["Count"];
  20. unset ($count);
  21. }
  22. }
  23. }
  24. option::set('bbaa_math_text',json_encode($dataqx));
  25. /* Model:曲线图变化速度信息收集模块 End */
复制代码
悄悄告诉你我是隐藏的彩蛋,找到没奖

TOP

本帖最后由 bbaa 于 2017-7-21 17:38 编辑

回复 121# 523066680


    厉害了
    PS:
Post send:
getchangeforminutebytext 一分钟
getchangefortenminutebytext 十分钟
getchangeforhourbytext 一小时
getchangeforhalfhourbytext 半小时
获取图片
Get page:
imagetop [获取榜单]
imageminute
imagetenminute
imagehour
imagehalfhour

这么长的函数我要吐了....
可以获取内置的检测数据[采样时间固定....]
    我去加个10分钟和半小时的
    曲线图明天应该就能完成,数据采样应该是5分钟一次
  1. $change_d=array();
  2. $timestamp=time()-(int)$change["change"]["minute"]["last"]["Timestamp"];
  3. if ($timestamp>=60||count($change["change"]["minute"]["last"]["user"])==0) {
  4. if((int)$change["change"]["minute"]["last"]["Timestamp"]!==0) {
  5. foreach($change["change"]["minute"]["last"]["user"] as $key=>$value) {
  6. $change_d[$key]=(int)$json["Username"][$key]["Count"]-(int)$value;
  7. }
  8. arsort($change_d);
  9. unset($change["change"]["minute"]["done"]);
  10. $change["change"]["minute"]["done"]["user"]=$change_d;
  11. $change["change"]["minute"]["done"]["lastu"]=$change["change"]["minute"]["last"]["user"];
  12. }
  13. unset($change["change"]["minute"]["last"]);
  14. foreach($json["Username"] as $key=>$value) {
  15. $change["change"]["minute"]["last"]["user"][$key]=(int)$value["Count"];
  16. }
  17. $change["change"]["minute"]["last"]["Timestamp"]=time();
  18. }
  19. unset($change_d);
  20. $change_d=array();
  21. $timestamp=time()-(int)$change["change"]["hour"]["last"]["Timestamp"];
  22. if ($timestamp>=3600||count($change["change"]["hour"]["last"]["user"])==0) {
  23. if((int)$change["change"]["hour"]["last"]["Timestamp"]!==0) {
  24. foreach($change["change"]["hour"]["last"]["user"] as $key=>$value) {
  25. $change_d[$key]=(int)$json["Username"][$key]["Count"]-(int)$value;
  26. }
  27. arsort($change_d);
  28. unset($change["change"]["hour"]["done"]);
  29. $change["change"]["hour"]["done"]["user"]=$change_d;
  30. $change["change"]["hour"]["done"]["lastu"]=$change["change"]["hour"]["last"]["user"];
  31. }
  32. unset($change["change"]["hour"]["last"]);
  33. foreach($json["Username"] as $key=>$value) {
  34. $change["change"]["hour"]["last"]["user"][$key]=(int)$value["Count"];
  35. }
  36. $change["change"]["hour"]["last"]["Timestamp"]=time();
  37. }
  38. unset($change_d);
  39. $change_d=array();
  40. $timestamp=time()-(int)$change["change"]["tenminute"]["last"]["Timestamp"];
  41. if ($timestamp>=600||count($change["change"]["tenminute"]["last"]["user"])==0) {
  42. if((int)$change["change"]["tenminute"]["last"]["Timestamp"]!==0) {
  43. foreach($change["change"]["tenminute"]["last"]["user"] as $key=>$value) {
  44. $change_d[$key]=(int)$json["Username"][$key]["Count"]-(int)$value;
  45. }
  46. arsort($change_d);
  47. unset($change["change"]["tenminute"]["done"]);
  48. $change["change"]["tenminute"]["done"]["user"]=$change_d;
  49. $change["change"]["tenminute"]["done"]["lastu"]=$change["change"]["tenminute"]["last"]["user"];
  50. }
  51. unset($change["change"]["tenminute"]["last"]);
  52. foreach($json["Username"] as $key=>$value) {
  53. $change["change"]["tenminute"]["last"]["user"][$key]=(int)$value["Count"];
  54. }
  55. $change["change"]["tenminute"]["last"]["Timestamp"]=time();
  56. }
  57. unset($change_d);
  58. $change_d=array();
  59. $timestamp=time()-(int)$change["change"]["halfhour"]["last"]["Timestamp"];
  60. if ($timestamp>=1800||count($change["change"]["halfhour"]["last"]["user"])==0) {
  61. if((int)$change["change"]["halfhour"]["last"]["Timestamp"]!==0) {
  62. foreach($change["change"]["halfhour"]["last"]["user"] as $key=>$value) {
  63. $change_d[$key]=(int)$json["Username"][$key]["Count"]-(int)$value;
  64. }
  65. arsort($change_d);
  66. unset($change["change"]["halfhour"]["done"]);
  67. $change["change"]["halfhour"]["done"]["user"]=$change_d;
  68. $change["change"]["halfhour"]["done"]["lastu"]=$change["change"]["halfhour"]["last"]["user"];
  69. }
  70. unset($change["change"]["halfhour"]["last"]);
  71. foreach($json["Username"] as $key=>$value) {
  72. $change["change"]["halfhour"]["last"]["user"][$key]=(int)$value["Count"];
  73. }
  74. $change["change"]["halfhour"]["last"]["Timestamp"]=time();
  75. }
  76. option::set('bbaa_math_change',json_encode($change));
  77. /* Model_Change_Get End*/
复制代码
暴力复制法 懒得简化咯
1

评分人数

TOP

我的方案已经改善,初接触多线程,各种问题还不知道怎么处理,边学边改
  1. bbaa        1442 + 5     1.9/min
  2. vic2        1360 + 21    8.2/min
  3. codegay      429 + 5     1.9/min
  4. vic3           0 + 0     0.0/min
复制代码
1

评分人数

TOP

本帖最后由 bbaa 于 2017-7-21 18:09 编辑


根据@老刘的代码基础上修改
添加了
1.Token改变后的赢家显示
修改了@老刘用Split取得数组改成Array
2.经测试双开速度能勉强达到与523066680的分段多线程方法不相上下
二分法:
  1. Const [宿主] = "CSCRIPT.EXE" 'WSCRIPT
  2. If Not UCase(Right(WScript.FullName,11)) = UCase([宿主]) Then
  3. Dim Args,Arg
  4. For Each Arg in Wscript.Arguments
  5. Args=Args&Chr(&H20)&Chr(&H22)&Arg&Chr(&H22)
  6. Next
  7. CreateObject("Wscript.Shell").Run _
  8. [宿主]&Chr(&H20)&Chr(&H22)&WScript.ScriptFullName&Chr(&H22)&Args
  9. WScript.Quit
  10. End If
  11. on error resume next
  12. If MsgBox("是否查看原贴?",1) = 1 Then CreateObject("Wscript.Shell").run "http://www.bathome.net/thread-44616-1-1.html"
  13. With CreateObject("MSXML2.XMLHTTP")
  14. .Open "POST", "http://bbaass.tk/math/", False
  15. .setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
  16. .Send "send=reg&username=老刘"
  17. End With
  18. dim tokens,[大鱼小鱼或等鱼?],[Arr返回的数据]
  19. High = 10001
  20. Low = -1
  21. Do
  22. Do
  23. Mid_=(High+Low)\2
  24. [Arr返回的数据] = Math(Mid_)
  25. [大鱼小鱼或等鱼?] = [Arr返回的数据](0)
  26. if tokens<>[Arr返回的数据](1) then
  27. If [大鱼小鱼或等鱼?] = "=" then
  28. wscript.echo "Win!The number is "&Mid_
  29. Else
  30. Wscript.echo "The token has changed By:"&[Arr返回的数据](2)
  31. End if
  32. tokens=[Arr返回的数据](1)
  33. High = 10001
  34. Low = -1
  35. Exit do
  36. Else
  37. Select Case [大鱼小鱼或等鱼?]
  38. Case ">"
  39. WScript.Echo ">,so try "&Low&","&Mid_
  40. High = Mid_
  41. Case "<"
  42. WScript.Echo "<,so try "&Mid_&","&High
  43. Low = Mid_
  44. End Select
  45. End if
  46. Loop
  47. Loop
  48. Function Math(num)
  49. dim [返回数据]
  50. With CreateObject("MSXML2.XMLHTTP")
  51. .Open "POST","http://bbaass.tk/math/", False
  52. .setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
  53. .send "send=Answer&math=" & num & "&username=老刘"
  54. [返回数据] = .responseText
  55. Math = Array(Split(Split([返回数据],",")(2),"""")(3),Split([返回数据],"""")(13),Split(Split([返回数据],",")(1),"""")(3))
  56. End With
  57. End Function
复制代码
随机摸鱼法:
  1. Const [宿主] = "CSCRIPT.EXE" 'WSCRIPT
  2. If Not UCase(Right(WScript.FullName,11)) = UCase([宿主]) Then
  3. Dim Args,Arg
  4. For Each Arg in Wscript.Arguments
  5. Args=Args&Chr(&H20)&Chr(&H22)&Arg&Chr(&H22)
  6. Next
  7. CreateObject("Wscript.Shell").Run _
  8. [宿主]&Chr(&H20)&Chr(&H22)&WScript.ScriptFullName&Chr(&H22)&Args
  9. WScript.Quit
  10. End If
  11. on error resume next
  12. If MsgBox("是否查看原贴?",1) = 1 Then CreateObject("Wscript.Shell").run "http://www.bathome.net/thread-44616-1-1.html"
  13. With CreateObject("MSXML2.XMLHTTP")
  14. .Open "POST", "http://bbaass.tk/math/", False
  15. .setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
  16. .Send "send=reg&username=老刘"
  17. End With
  18. dim tokens,[大鱼小鱼或等鱼?],[Arr返回的数据]
  19. High = 10001
  20. Low = -1
  21. Do
  22. Do
  23. Randomize()
  24. Mid_=Fix((High - Low + 1) * Rnd + Low)
  25. [Arr返回的数据] = Math(Mid_)
  26. [大鱼小鱼或等鱼?] = [Arr返回的数据](0)
  27. if tokens<>[Arr返回的数据](1) then
  28. If [大鱼小鱼或等鱼?] = "=" then
  29. wscript.echo "Win!The number is "&Mid_
  30. Else
  31. Wscript.echo "The token has changed By:"&[Arr返回的数据](2)
  32. End if
  33. tokens=[Arr返回的数据](1)
  34. High = 10001
  35. Low = -1
  36. Exit do
  37. Else
  38. Select Case [大鱼小鱼或等鱼?]
  39. Case ">"
  40. WScript.Echo ">,so try "&Low&","&Mid_
  41. High = Mid_
  42. Case "<"
  43. WScript.Echo "<,so try "&Mid_&","&High
  44. Low = Mid_
  45. End Select
  46. End if
  47. Loop
  48. Loop
  49. Function Math(num)
  50. dim [返回数据]
  51. With CreateObject("MSXML2.XMLHTTP")
  52. .Open "POST","http://bbaass.tk/math/", False
  53. .setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
  54. .send "send=Answer&math=" & num & "&username=老刘"
  55. [返回数据] = .responseText
  56. Math = Array(Split(Split([返回数据],",")(2),"""")(3),Split([返回数据],"""")(13),Split(Split([返回数据],",")(1),"""")(3))
  57. End With
  58. End Function
复制代码
1

评分人数

TOP


TOP

本帖最后由 bbaa 于 2017-7-21 13:31 编辑

回复 117# 523066680


    是啊
  1. Const [宿主] = "CSCRIPT.EXE" 'WSCRIPT
  2. If Not UCase(Right(WScript.FullName,11)) = UCase([宿主]) Then
  3. Dim Args,Arg
  4. For Each Arg in Wscript.Arguments
  5. Args=Args&Chr(&H20)&Chr(&H22)&Arg&Chr(&H22)
  6. Next
  7. CreateObject("Wscript.Shell").Run _
  8. [宿主]&Chr(&H20)&Chr(&H22)&WScript.ScriptFullName&Chr(&H22)&Args
  9. WScript.Quit
  10. End If
  11. on error resume next
  12. If MsgBox("是否查看原贴?",1) = 1 Then CreateObject("Wscript.Shell").run "http://www.bathome.net/thread-44616-1-1.html"
  13. With CreateObject("MSXML2.XMLHTTP")
  14. .Open "POST", "http://bbaass.tk/math/", False
  15. .setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
  16. .Send "send=reg&username=bbaa"
  17. End With
  18. dim tokens,[大鱼小鱼或等鱼?],[Arr返回的数据]
  19. High = 10001
  20. Low = -1
  21. Do
  22. Do
  23. 'Randomize()
  24. Mid_=Fix((High - Low + 1) * Rnd + Low)
  25. [Arr返回的数据] = Math(Mid_)
  26. [大鱼小鱼或等鱼?] = [Arr返回的数据](0)
  27. if tokens<>[Arr返回的数据](1) then
  28. If [大鱼小鱼或等鱼?] = "=" then
  29. wscript.echo "Win!The number is "&Mid_
  30. Else
  31. Wscript.echo "The token has changed"
  32. 'Wscript.echo [Arr返回的数据](1)
  33. End if
  34. tokens=[Arr返回的数据](1)
  35. High = 10001
  36. Low = -1
  37. Exit do
  38. Else
  39. Select Case [大鱼小鱼或等鱼?]
  40. Case ">"
  41. WScript.Echo ">,so try "&Low&","&Mid_
  42. High = Mid_
  43. Case "<"
  44. WScript.Echo "<,so try "&Mid_&","&High
  45. Low = Mid_
  46. End Select
  47. End if
  48. Loop
  49. Loop
  50. Function Math(num)
  51. dim [返回数据]
  52. With CreateObject("MSXML2.XMLHTTP")
  53. .Open "POST","http://bbaass.tk/math/", False
  54. .setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
  55. .send "send=Answer&math=" & num & "&username=bbaa"
  56. [返回数据] = .responseText
  57. Math = Split(Split(Split([返回数据],",")(2),"""")(3) & " "&Split([返回数据],"""")(13)," ")
  58. End With
  59. End Function
复制代码
基于老刘修改的随机摸鱼
一个用老刘的二分同时开

TOP

回复 116# bbaa


    你的是用多线程以外的方案吗?好快。

TOP

回复 115# 523066680


    为了竞争的公平性 集体清0... 才不会告诉你Sql语句打错了.........
靠- -

TOP

本帖最后由 523066680 于 2017-7-21 12:25 编辑

回复 114# bbaa


    咦 重置了?
repeat
codegay    28209 + -28209 -871.6/min
vic2       14805 + -14802 -457.3/min
老刘        4983 + -4983 -154.0/min
bbaa         458 + -458  -14.2/min
vic3         127 + -127  -3.9/min

一大波负数,哈哈。

PHP JS HTML 不太懂,本地动态折线图我可以用 Perl+OpenGL 做。

TOP

回复 110# 523066680


    username 除了reg 和Answer外是可选项
主要是在线监测..

TOP

返回列表