NegativeNrG Posted December 28, 2005 Posted December 28, 2005 Test it to see if it stops or doesnt stop the whole script. [size=20]My File Upload[/size]Register at my site and upload.
LxP Posted December 29, 2005 Posted December 29, 2005 I must admit that I'm not entirely sure of what you want to do. When you run this line:GUICtrlRead($loot)what do you wish to happen? I suspect that you want the Space key to be pressed if a certain condition is true, so perhaps you wish to do something like this:Global $DoLoot = 0 Func Loot() Global $DoLoot If $DoLoot Then Send('{SPACE}') EndFunc ··· If $Button = $GUI_CHECKED Then $DoLoot = 1 Else $DoLoot = 0 EndIf ··· ; some commands ; some commands ; some commands Loot() ; some commands ; some commands ; some commands Loot() ; some commands ; some commands ; some commandsIn the above code, when Loot() is called the Send() will only be triggered if $DoLoot is not equal to 0.
Mike :) Posted December 29, 2005 Author Posted December 29, 2005 LxP, in previous code I was just trying different ways to put it all to work, i never thought GUICtrlRead($loot) could work ^^. Thanks for the code, I done it like this: $autoloot = GUICtrlCreateCheckbox ("Auto PickUp", 120,153) Then Func Loot() If GUICtrlread($autoloot) = 1 Then Send("{SPACE}") Else EndIf And here's code fragment ( i changed it completely in order to use less space, so I made it all in variables, theres just 1 scheme rest are vars): If GUICtrlRead ( $afk1 ) = $GUI_CHECKED AND GUICtrlRead ( $heal ) = $GUI_CHECKED Then Global $kolor1 = PixelGetColor( $pxl1,$buff1y ) Call ("SmartHeal_") Call ("Loot") ElseIf GUICtrlRead ( $afk2 ) = $GUI_CHECKED AND GUICtrlRead ( $heal ) = 1 OR 0 Then WinActivate("Bez tytułu - Notatnik", "") Send("1") Call ("Buff") Call ("Loot") Else Call ("Loot") EndIf Well, it works Thanks alot guys! But here's my another problem: ...To be continued in other topic...
LxP Posted December 29, 2005 Posted December 29, 2005 Here are some small suggestions for improvement:The Loot() function can be simplified to this:Func Loot() If GUICtrlRead($AutoLoot) = 1 Then Send('{SPACE}') EndFuncAlso, instead of Call('XYZ') you can use XYZ(), i.e. --If GUICtrlRead($AFK1) = $GUI_CHECKED AND GUICtrlRead($Heal) = $GUI_CHECKED Then Global $Kolor1 = PixelGetColor($Pxl1, $Buff1Y) SmartHeal_() ; Note the corrected line below ElseIf GUICtrlRead ($afk2) = $GUI_CHECKED And GUICtrlRead($Heal) = 1 Or GUICtrlRead($Heal) = 0 Then WinActivate('Bez tytułu - Notatnik') Send('1') Buff() EndIf ; Since Loot() is always called it does not need to be part of the If..EndIf block Loot()Both ideas will use less CPU.
Mike :) Posted December 29, 2005 Author Posted December 29, 2005 (edited) Thanks, I'll add them ASAP !!! Cool ideas anyway I added more Loot just for fun, so it picks up more items in-game that's important for me so i left it alone. Here's how my Loot looks like now (couldn't change it at all) Func Loot() If GUICtrlRead($autoloot) = 1 Then MsgBox (0, "loading", "" ,1) Sleep(1000) Sendstr('{SPACE}', 1000) Sendstr('{SPACE}', 1000) EndIf EndFunc Func Sendstr($istr,$idelay) Opt('SendKeyDownDelay',$idelay) Send ($istr) EndFunc Well, I think it's ok Edited December 29, 2005 by Mike :)
LxP Posted December 29, 2005 Posted December 29, 2005 Here's another small improvement if you're interested: Func Loot() If GUICtrlRead($AutoLoot) = 1 Then SplashTextOn('', @LF & 'Loading...', 120, 65, -1, -1, 1) Sleep(1000) SendStr('{SPACE 2}', 1000) SplashOff() EndIf EndFunc
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