tijn Posted August 24, 2007 Share Posted August 24, 2007 hello;) First ofall ,im new to this forums, lemme introduce myself:) Im Lutijn from holland, 16 years old and football fan, also a silkroadonline botter. Well, my script needs to do this: Click on P to see if there are 3 people in party, if not: Click E and click on form party Click on OK Waits till someone ones to join and clicks on ACCEPT if there popsup a window from someone wanting to join PT Well, this is it: While 1 $msg = GUIGetMsg() WEnd func check() if WinExists("SRO_Client") then Send "P" [, 1] if pixelgetcolor(630,483) = 0x000000 then Send "E" [, 1] MouseClick "left", 612, 591, 1 sleep(1000) MouseClick "left", 461, 541, 1 sleep(1000) if pixelgetcolor(875,752) = 0xD4D0C8 then sleep(200) MouseClick "left", 875, 752, 1 EndIf EndIf EndIf endfunc Does anyone know if there are any bugs in this? Im new, dont be harse at me please . CYas! Link to comment Share on other sites More sharing options...
Nahuel Posted August 24, 2007 Share Posted August 24, 2007 (edited) I don't see bugs, but I do see sytax mistakes. You are not using brackets for the functions and the [ ] on a function description tell you that that parameter is optional. You don't have to put it. While 1 $msg = GUIGetMsg() WEnd func check() if WinExists("SRO_Client") then Send ("P" , 1) if pixelgetcolor(630,483) = 0x000000 then Send ("E" , 1) MouseClick ("left", 612, 591, 1) sleep(1000) MouseClick ("left", 461, 541, 1) sleep(1000) if pixelgetcolor(875,752) = 0xD4D0C8 then sleep(200) MouseClick ("left", 875, 752, 1) EndIf EndIf EndIf endfunc If you use SciTE, press Ctrl+F5 for SintaxCheck Prod. Edited August 24, 2007 by Nahuel Link to comment Share on other sites More sharing options...
tijn Posted August 24, 2007 Author Share Posted August 24, 2007 Sorry, im 100% new to scripting, I use autoit to get the logical thinking to go on on harder scriptlanguages in a year or 2. What do you mean with brackets? The syntax cheker lets me know theres something wrong with sending P .... updated something, added WinActivate so it runs SRO before pushing P >.< While 1 $msg = GUIGetMsg() WEnd func check() if WinExists("SRO_Client") then WinActivate("SRO_Client", "") sleep(1000) Send "P" [, 1] if pixelgetcolor(630,483) = 0x000000 then Send "E" [, 1] MouseClick "left", 612, 591, 1 sleep(1000) MouseClick "left", 461, 541, 1 sleep(1000) if pixelgetcolor(875,752) = 0xD4D0C8 then sleep(200) MouseClick "left", 875, 752, 1 EndIf EndIf EndIf endfunc Link to comment Share on other sites More sharing options...
Nahuel Posted August 24, 2007 Share Posted August 24, 2007 All the functions have a similar structure:function($parameter)your script won't work because you typed: Send "P" [, 1] when it should be Send("P",1) When you read a function description on the help file, it will show you parameters in [ ]. That means that those are optional. You do not have to type the [ ] like you did with the send functions. Use the examples and the help file, they are VERY useful! Link to comment Share on other sites More sharing options...
Zedna Posted August 24, 2007 Share Posted August 24, 2007 In the Helpfile are sections usefull for beginners: Using AutoIt Tutorials Language Reference Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
tijn Posted August 25, 2007 Author Share Posted August 25, 2007 sorry guys, and thanks alot! 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