lee90 Posted May 27, 2009 Share Posted May 27, 2009 I'm trying to make an auto-pot bot .. the bot will help me to click and to drink pot when the hp is low at certain point.. i have created 2 scripts; a)auto click bot b)auto pot bot, however, i have no idea how to combine it together to make it works Auto click Botexpandcollapse popupDo $pass = InputBox ("Password", "Please enter your password","","*",180,150) If $pass <> "1234" Then MsgBox (0,"Warning" , "Password Invalid" & @CRLF & "") EndIf Until $pass == "1234" MsgBox (0,"Credit" , "Created by lee90 aka 老人一个 (BETA)") WinActivate("xxx.exe", "") WinMove("xxx.exe", "", 0, 0) Global $UnPaused HotKeySet("{F4}", "TogglePause") HotKeySet("{ESC}", "Terminate") While 1 Sleep(100) ToolTip("Press F4 to start.. Esc to quit..",0,0) WEnd Func TogglePause() $UnPaused = NOT $UnPaused While $UnPaused ToolTip("Press F4 to Pause Credit: lee90 aka xxx",0,0) AutoItSetOption ("MouseClickDelay",100) MouseClick ( "left" , 320, 433 , 1 , 0 ) MouseClick ( "left" , 186, 164, 1 , 0 ) MouseClick ( "left" , 186, 460 , 1 , 0 ) MouseClick ( "left" , 740, 154 , 1 , 0 ) MouseClick ( "left" , 465, 154 , 1 , 0 ) MouseClick ( "left" , 203, 333 , 1 , 0 ) MouseClick ( "left" , 205, 343 , 1 , 0 ) Sleep(100) WEnd EndFunc Func Terminate() Exit 0 EndFuncAuto pot BotDo $coord = PixelSearch (118, 47, 120, 49, 0x083042, 1, 1) If Not @error then MouseClick("right", 38, 64, 1, 0) EndIf Until ProcessClose ("xxx.exe")=TrueCan anyone help me to combine this 2 bot together? Thank You. Link to comment Share on other sites More sharing options...
Triblade Posted May 27, 2009 Share Posted May 27, 2009 If you make it a function, you could call it every While-loop. Func pixsearch() <copy-paste code here> WITHOUT Do-Until!! EndFunc And type after Sleep(100): "pixsearch()" Then every loop you execute that pixelsearch function. My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) Link to comment Share on other sites More sharing options...
lee90 Posted May 27, 2009 Author Share Posted May 27, 2009 I still dont understand Can u help me to combine it? Hehe Link to comment Share on other sites More sharing options...
Triblade Posted May 27, 2009 Share Posted May 27, 2009 In your code you know to make functions. so: Func searchpix() $coord = PixelSearch (118, 47, 120, 49, 0x083042, 1, 1) If Not @error then MouseClick("right", 38, 64, 1, 0) EndIf EndFunc Paste this code below all other code. Then past "searchpix()" above "Sleep(100)". This will make the script search the pixel every 100ms. My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) Link to comment Share on other sites More sharing options...
lee90 Posted May 27, 2009 Author Share Posted May 27, 2009 tried, but it keeps on helping me to drink pot even though my hp is full =o= Link to comment Share on other sites More sharing options...
Triblade Posted May 28, 2009 Share Posted May 28, 2009 Then your code is flawed somewhere, the implementation of the function is basic/simple. The content of the function, however, is what you wrote. My active project(s): A-maze-ing generator (generates a maze) My archived project(s): Pong3 (Multi-pinger) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now