首页 游戏辅助开发技术动态 用vbs脚本开发的局网游戏可智能加血外挂(基础练手教程)_正文

用vbs脚本开发的局网游戏可智能加血外挂(基础练手教程)

导读:近期有不少的网友来问游戏外挂开发的编程问题,甚至有要从"零"开始学习游戏脚本编程的,我们目前没有这个"收徒"业务,但技术会时不时的发布一些游...

近期有不少的网友来问游戏外挂开发的编程问题,甚至有要从"零"开始学习游戏脚本编程的,我们目前没有这个"收徒"业务,但技术会时不时的发布一些游戏辅助开发的实例教程,希望可以帮到各位!

下面提供一个用vbs脚本开发一款局网游戏(古惑仔游戏)的实例教程,主要是从脚本代码入手,以下代码中都"标配"有中文提示,包括游戏中对话框的提示!

a1.jpg

set Obj = createobject("WScript.Shell")

VBS YN=Obj.Popup("欢迎使用《淡月下清荷》古惑仔外挂程序,《自动式》恢复生命值吗?",0,"关机?",36)

Gosub jiance

///////检测位置

up=500

down=0

Rem brotherset

VBSCall up=InputBox ("请设置攻击目标的 兄弟上限")

VBSCall down=InputBox ("请设置攻击目标的 兄弟下限")

If down>up

MessageBox "输入错误"

Goto brotherset

EndIf

//Popup--弹出对话框

Delay 2000

Rem start

MoveTo 250,12

LeftClick 1

Delay 3000

MoveTo 1012,123

LeftDown 1

Delay 1000

LeftUp 1

Rem xunhuan

MoveTo hpx,z2

LeftClick 1

Delay 5000

////通过剪贴板判断生命和体力值

VBS Set objIE = CreateObject("InternetExplorer.Application")

VBS objIE.Navigate("about:blank")

MoveTo smx,z1

LeftDown 1

MoveTo smy,z1

LeftUp 1

KeyDown 17,1

KeyPress 67,1

KeyUp 17,1

VBS life = objIE.document.parentwindow.clipboardData.GetData("text")

MoveTo tlx,z1

LeftDown 1

MoveTo tly,z1

LeftUp 1

KeyDown 17,1

KeyPress 67,1

KeyUp 17,1

LeftClick 1

VBS stength = objIE.document.parentwindow.clipboardData.GetData("text")

VBS objIE.Quit

////判断是否要攻击或者加血或者等待

If life<20

If stength>0

If YN=6

Gosub jiaxue

Else ""

set Objz = createobject("WScript.Shell")

VBS YON=Objz.Popup("生命不足,你确定要花钱恢复生命吗?",0,"关机?",36)

If YON=6

LeftClick 1

Gosub jiaxue

Else

Goto wait

EndIf

EndIf

Else

Goto wait

EndIf

ElseIf life>22

If stength>0

Gosub gongji

Else

Goto wait

EndIf

Else

Goto wait

EndIf

Goto xunhuan

Rem wait

Delay 360000

Goto start

EndScript //////加血和攻击子程序

//////加血和攻击子程序

Sub jiaxue

MoveTo zsx,z2

LeftClick 1

Delay 3000

MoveTo 180,425

LeftClick 1

Delay 3000

Return jiaxue

Sub gongji

VBS Set objIE = CreateObject("InternetExplorer.Application")

VBS objIE.Navigate("about:blank")

For 5

MoveTo gjx,z3

LeftDown 1

MoveTo gjy,z3

LeftUp 1

KeyDown 17,1

KeyPress 67,1

KeyUp 17,1

VBS brother = objIE.document.parentwindow.clipboardData.GetData("text")

If brother<up

If brother>down

MoveTo gjz,z3

LeftClick 1

Delay 5000

Else

Rem willout

EndIf

Else

Rem willout

EndIf

z3=z3+34

EndFor

Rem willout

VBS objIE.Quit

Return jiaxue

Sub jiance

z1=285

smx=232

smy=244

tlx=495

tly=502

z2=313

hpx=393

zsx=523

z3=455

gjx=633

gjy=556

gjz=730

set Objall= createobject("WScript.Shell")

VBS zscjc=Objall.Popup("是否对 鼠标坐标 进行检测?",0,"关机?",36)

If zscjc=6

MessageBox "生命点数位置检测(初始值232,244,z1=285)。按任意键继续检测!"

MoveTo 250,12

LeftClick 1

Delay 2000

MoveTo smx,z1

LeftDown 1

MoveTo smy,z1

LeftUp 1

WaitKey

set Obja= createobject("WScript.Shell")

VBS xiugai=Obja.Popup("坐标是否准确?点击《确定》进行修改",0,"关机?",36)

LeftClick 1

If xiugai=6

Rem sunch1

MessageBox "生命值位置:关闭本对话框后,把鼠标移动到生命值两端端,按键盘 即可!"

MoveTo 250,12

LeftClick 1

WaitKey

VBSCall GetCursorPos(smx,z1)

WaitKey

VBSCall GetCursorPos(smy,z1)

MoveTo smx,z1

LeftDown 1

MoveTo smy,z1

LeftUp 1

WaitKey

set Obja= createobject("WScript.Shell")

VBS xiugai=Obja.Popup("再一次修改?",0,"关机?",36)

If xiugai=6

Goto sunch1

EndIf

EndIf

MessageBox "体力点数位置检测(初始值495,502,z1=285)。按任意键继续检测!"

MoveTo tlx,z1

LeftClick 1

Delay 500

LeftDown 1

MoveTo tly,z1

LeftUp 1

WaitKey

set Obja= createobject("WScript.Shell")

VBS xiugai=Obja.Popup("坐标是否准确?点击《确定》进行修改",0,"关机?",36)

LeftClick 1

If xiugai=6

Rem sunch2

MessageBox "体力值位置:关闭本对话框后,把鼠标移动到体力值两端端,按键盘 即可!"

MoveTo 250,12

LeftClick 1

WaitKey

VBSCall GetCursorPos(tlx,z1)

WaitKey

VBSCall GetCursorPos(tly,z1)

MoveTo tlx,z1

LeftDown 1

MoveTo tly,z1

LeftUp 1

WaitKey

set Obja= createobject("WScript.Shell")

VBS xiugai=Obja.Popup("再一次修改?",0,"关机?",36)

If xiugai=6

Goto sunch2

EndIf

EndIf

MessageBox "火拼位置检测(初始值393,z2=313)。按任意键继续检测!"

MoveTo 250,12

LeftClick 1

Delay 2000

MoveTo hpx,z2

WaitKey

set Obja= createobject("WScript.Shell")

VBS xiugai=Obja.Popup("坐标是否准确?点击《确定》进行修改",0,"关机?",36)

LeftClick 1

If xiugai=6

MessageBox "火拼位置:关闭本对话框后,把鼠标移动到火拼位置上,按键盘 即可!"

VBSCall GetCursorPos(hpx,z2)

EndIf

MessageBox "诊所位置检测(初始值523,z2=313)。按任意键继续检测!"

MoveTo 250,12

LeftClick 1

Delay 2000

MoveTo zsx,z2

WaitKey

set Obja= createobject("WScript.Shell")

VBS xiugai=Obja.Popup("坐标是否准确?点击《确定》进行修改",0,"关机?",36)

LeftClick 1

If xiugai=6

MessageBox "诊所位置:关闭本对话框后,把鼠标移动到 诊所 位置上,按键盘 即可!"

VBSCall GetCursorPos(zsx,z2)

EndIf

MessageBox "攻击目标位置检测(初始值556,633,730,z3=455)。按任意键继续检测!"

MoveTo gjx,z3

LeftClick 1

Delay 500

LeftDown 1

MoveTo gjy,z3

LeftUp 1

WaitKey

set Obja= createobject("WScript.Shell")

VBS xiugai=Obja.Popup("坐标是否准确?点击《确定》进行修改",0,"关机?",36)

LeftClick 1

If xiugai=6

Rem sunch3

MessageBox "兄弟数位置:关闭本对话框后,把鼠标移动到兄弟数两端,按键盘 即可!"

MoveTo 250,12

LeftClick 1

WaitKey

VBSCall GetCursorPos(gjx,z3)

WaitKey

VBSCall GetCursorPos(gjy,z3)

MoveTo gjx,z3

LeftDown 1

MoveTo gjy,z3

LeftUp 1

WaitKey

set Obja= createobject("WScript.Shell")

VBS xiugai=Obja.Popup("再一次修改?",0,"关机?",36)

If xiugai=6

Goto sunch3

EndIf

EndIf

MoveTo gjz,z3

WaitKey

set Obja= createobject("WScript.Shell")

VBS xiugai=Obja.Popup("坐标是否准确?点击《确定》进行修改",0,"关机?",36)

LeftClick 1

If xiugai=6

MessageBox "攻击位置:关闭本对话框后,把鼠标移动到攻击位置上,按键盘 即可!"

VBSCall GetCursorPos(gjz,z2)

EndIf

EndIf

Return jiaxue

////END

本文地址:http://eedating.com/kfjs/55.html
若非特殊说明,转载请注明原链接。
辅助定制开发-游戏称王,为你加冕
«    2022年1月    »
12
3456789
10111213141516
17181920212223
24252627282930
31

退出请按Esc键