Advertisement
Guest User

自動喊話

a guest
Feb 6th, 2015
605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QBasic 3.85 KB | None | 0 0
  1. //----------------------------------------------------註冊大漠插件
  2.  
  3. PutAttachment ".\plugin", "RegDll.dll"
  4. PutAttachment ".\plugin\dm", "dm.dll"
  5. CALL Plugin.RegDll.Reg("C:\test_game\dm.dll")
  6. Set dm = createobject("dm.dmsoft")
  7.  
  8. //這裡設置插件基本目錄
  9. dm.SetPath "C:\test_game"
  10. //dm_ret = dm.SetDict(0, "dm_soft.txt")
  11.  
  12. // 獲取句柄
  13. hwnd = dm.GetMousePointWindow()
  14. // 綁定
  15. dm_ret = dm.BindWindow(hwnd,"dx","dx2","dx",0)
  16.  
  17. //----------------------------------------------------註冊大漠插件結束
  18.  
  19.  
  20. //抓抓的X座標-7 = 大漠的X坐標
  21. //抓抓的Y座標-29 = 大漠的Y坐標
  22. Dimenv a
  23. DimEnv x
  24. DimEnv n
  25. Dimenv t
  26. //-----------------------計時器---------------------------------------------------------------
  27. Event Form1.LoadOver  
  28.     Form1.Timer1.Enabled = 1   //開啟定時器  
  29.     Form1.Timer1.Interval = 500  //設置定時器循環的間隔時間(單位:毫秒)  
  30. END Event
  31. Event Form1.Timer1.TIMER
  32.     a = Form1.InputBox1.Text
  33.     x = Form1.InputBox2.Text
  34.     t = Form1.InputBox3.Text
  35. END Event
  36. //-----------------------自定義輸入框---------------------------------------------------------------
  37. Event Form1.InputBox1.Change
  38.     a = Form1.InputBox1.Text
  39. END Event
  40. Event Form1.InputBox2.Change
  41.     x = Form1.InputBox2.Text
  42. END Event
  43. Event Form1.InputBox3.Change
  44.     t = Form1.InputBox3.Text
  45. END Event
  46. //-----------------------視窗解析度與位置------------------------------------------------------------
  47. dm.MoveWindow hwnd,0,0
  48. dm_ret = dm.SetClientSize(hwnd, 800, 600)
  49. MessageBox "自動喊話開始"
  50. //-----------------------判斷對話框是否活化----------------------------------------------------------
  51. dm_ret = dm.FindColor(0,0,2000,2000,"98cc24-000000",0.9,0,intX,intY)
  52. IF intX >= 0 AND intY >= 0 THEN
  53.     dm.moveto 381, 218
  54.     Delay 200
  55.     dm.leftclick
  56. END IF
  57. //-----------------------是否要重複喊話--------------------------------------------------------------
  58. IF Form1.CheckBox1.Value = 1 THEN
  59.     DO
  60.         CALL 自動喊話()
  61.     LOOP
  62. ELSE
  63.     CALL 自動喊話()
  64. END IF
  65. //-----------------------副程式--------------------------------------------------------------------------
  66. SUB 自動喊話
  67.     TracePrint a
  68.     TracePrint x
  69.     TracePrint t
  70.     n = 1
  71.     Delay 500
  72.     //---------------------------------------------------------------------------------------------------------------
  73.     FOR x
  74.         dm.KeyPress 13
  75.         dm.moveto 148,218
  76.         dm.leftclick
  77.         Delay 500
  78.         //---------------------------------------------------------------------------------------------------------------
  79.         //判斷頻道
  80.         IF Form1.OptionBox1.Value = 1 THEN  
  81.             CALL Plugin.Bkgnd.SendString(hwnd, "/trade " & n)
  82.         ELSEIF Form1.OptionBox2.Value = 1 THEN  
  83.             CALL Plugin.Bkgnd.SendString(hwnd, "/global " & n)
  84.         END IF
  85.         //---------------------------------------------------------------------------------------------------------------
  86.         Delay 500
  87.         dm.KeyPress 13
  88.         Delay 500
  89.         dm.KeyPress 13
  90.         Delay 500
  91.         //---------------------------------------------------------------------------------------------------------------
  92.         //判斷頻道
  93.         IF Form1.OptionBox1.Value = 1 THEN  
  94.             CALL Plugin.Bkgnd.SendString(hwnd, "$"&a)
  95.         ELSEIF Form1.OptionBox2.Value = 1 THEN  
  96.             CALL Plugin.Bkgnd.SendString(hwnd, "#"&a)
  97.         END IF
  98.         //---------------------------------------------------------------------------------------------------------------
  99.         Delay 500
  100.         dm.KeyPress 13
  101.         Delay t
  102.         //---------------------------------------------------------------------------------------------------------------
  103.         IF x = n THEN
  104.             EXIT FOR   
  105.         END IF
  106.         n = n + 1
  107.     NEXT
  108. END SUB
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement