Jump to content

Recommended Posts

Posted (edited)

also,i dunno wuts wrong in this thing...

as u see i put in var's to be sent from input boxes..but even if leave some inputboxes empty..it still sends buttons according to the number at the end of each var... wat i want it to send is only the input boxes that have number entered..thnx for all help,rly apreciate it :mellow:

Send($skill1)
Sleep($s1)
Send($skill2)
Sleep($s2)
Send($skill3)
Sleep($s3)
Send($skill4)
Sleep($s4)
Send($skill5)
Sleep($s5)
Send($skill6)
Sleep($s6)
Send($skill7)
Sleep($s7)
Send($skill8)
Sleep($s8)
Send($skill9)
Sleep($s9)
Send($skill0)
Sleep($s0)
Edited by TomaSzz
Posted

Your $skill variables have no value, according to the code you have posted.

If you're using the Send() function to send keypresses, you need to give them a value.

Send("e") ;sends the keypress "e"
Send("{F4}") ;sends the keypress F4
Send("{ALTDOWN}{F4}{ALTUP}") ;holds down the alt key, presses the F4 key, releases the alt key

[center][/center]

Posted (edited)

but did u read first post? i hav input boxes...and i input in boxes number to be send from inputbox and if i leave my other input boxes the program still sends empty input boxes too...i only want data to be sent from inputboxes where is number written in it..or at least anythin..uknow..

as far as i understand it now i must enter every input box...

Edited by TomaSzz
Posted

erm i never used controlID so hm..

well i hav it like this

$skill1 = GUICtrlCreateInput("", 135, 160, 20, 20)
$skill2 = GUICtrlCreateInput("", 135, 190, 20, 20)
$skill3 = GUICtrlCreateInput("", 135, 220, 20, 20)
$skill4 = GUICtrlCreateInput("", 135, 250, 20, 20)
$skill5 = GUICtrlCreateInput("", 135, 280, 20, 20)
$skill6 = GUICtrlCreateInput("", 135, 310, 20, 20)
$skill7 = GUICtrlCreateInput("", 135, 340, 20, 20)
$skill8 = GUICtrlCreateInput("", 135, 370, 20, 20)
$skill9 = GUICtrlCreateInput("", 135, 400, 20, 20)
$skill0 = GUICtrlCreateInput("", 135, 430, 20, 20)
$s1 = GUICtrlCreateInput("", 165, 160, 50, 20)
$s2 = GUICtrlCreateInput("", 165, 190, 50, 20)
$s3 = GUICtrlCreateInput("", 165, 220, 50, 20)
$s4 = GUICtrlCreateInput("", 165, 250, 50, 20)
$s5 = GUICtrlCreateInput("", 165, 280, 50, 20)
$s6 = GUICtrlCreateInput("", 165, 310, 50, 20)
$s7 = GUICtrlCreateInput("", 165, 340, 50, 20)
$s8 = GUICtrlCreateInput("", 165, 370, 50, 20)
$s9 = GUICtrlCreateInput("", 165, 400, 50, 20)
$s0 = GUICtrlCreateInput("", 165, 430, 50, 20)

and then those  in case

$coord = PixelSearch(50, 106, 950, 334, 0x7F7F7F, 4)
If Not @error Then
MouseClickDrag("left", $coord[0], $coord[1], $coord[0] + 30, $coord[1] + 30)
EndIf
Send($skill1)
Sleep($s1)
Send($skill2)
Sleep($s2)
Send($skill3)
Sleep($s3)
Send($skill4)
Sleep($s4)
Send($skill5)
Sleep($s5)
Send($skill6)
Sleep($s6)
Send($skill7)
Sleep($s7)
Send($skill8)
Sleep($s8)
Send($skill9)
Sleep($s9)
Send($skill0)
Sleep($s0)
Posted

ok another issue :|

it wont go on other pixelsearch's just stays at first and keeps sending those send , sleep

While 1=1

$coord = PixelSearch(50, 106, 950, 334, 0x7F7F7F, 4)
If Not @error Then
MouseClickDrag("left", $coord[0], $coord[1], $coord[0] + 60, $coord[1] + 60)
EndIf
sleep(300)
Send(GuiCtrlRead($skill1))
Sleep(GuiCtrlRead($s1))
Send(GuiCtrlRead($skill2))
Sleep(GuiCtrlRead($s2))
Send(GuiCtrlRead($skill3))
Sleep(GuiCtrlRead($s3))
Send(GuiCtrlRead($skill4))
Sleep(GuiCtrlRead($s4))
Send(GuiCtrlRead($skill5))
Sleep(GuiCtrlRead($s5))


$coord = PixelSearch(584, 273, 952, 600, 0x7F7F7F, 4)
If Not @error Then
MouseClickDrag("left", $coord[0], $coord[1], $coord[0] + 60, $coord[1] + 60)
EndIf
sleep(300)
Send($skill1)
Send(GuiCtrlRead($skill1))
Sleep(GuiCtrlRead($s1))
Send(GuiCtrlRead($skill2))
Sleep(GuiCtrlRead($s2))
Send(GuiCtrlRead($skill3))
Sleep(GuiCtrlRead($s3))
Send(GuiCtrlRead($skill4))
Sleep(GuiCtrlRead($s4))
Send(GuiCtrlRead($skill5))
Sleep(GuiCtrlRead($s5))


$coord = PixelSearch(61, 434, 952, 600, 0x7F7F7F, 4)
If Not @error Then
MouseClickDrag("left", $coord[0], $coord[1], $coord[0] + 60, $coord[1] + 60)
EndIf
sleep(300)
Send(GuiCtrlRead($skill1))
Sleep(GuiCtrlRead($s1))
Send(GuiCtrlRead($skill2))
Sleep(GuiCtrlRead($s2))
Send(GuiCtrlRead($skill3))
Sleep(GuiCtrlRead($s3))
Send(GuiCtrlRead($skill4))
Sleep(GuiCtrlRead($s4))
Send(GuiCtrlRead($skill5))
Sleep(GuiCtrlRead($s5))


$coord = PixelSearch(50, 106, 415, 600, 0x7F7F7F, 4)
If Not @error Then
MouseClickDrag("left", $coord[0], $coord[1], $coord[0] + 60, $coord[1] + 60)
EndIf
sleep(300)
Send(GuiCtrlRead($skill1))
Sleep(GuiCtrlRead($s1))
Send(GuiCtrlRead($skill2))
Sleep(GuiCtrlRead($s2))
Send(GuiCtrlRead($skill3))
Sleep(GuiCtrlRead($s3))
Send(GuiCtrlRead($skill4))
Sleep(GuiCtrlRead($s4))
Send(GuiCtrlRead($skill5))
Sleep(GuiCtrlRead($s5))

WEnd
Posted (edited)

ok another issue :|

it wont go on other pixelsearch's just stays at first and keeps sending those send , sleep

While 1=1

$coord = PixelSearch(50, 106, 950, 334, 0x7F7F7F, 4)
If Not @error Then
MouseClickDrag("left", $coord[0], $coord[1], $coord[0] + 60, $coord[1] + 60)
EndIf
sleep(300)
Send(GuiCtrlRead($skill1))
Sleep(GuiCtrlRead($s1))
Send(GuiCtrlRead($skill2))
Sleep(GuiCtrlRead($s2))
Send(GuiCtrlRead($skill3))
Sleep(GuiCtrlRead($s3))
Send(GuiCtrlRead($skill4))
Sleep(GuiCtrlRead($s4))
Send(GuiCtrlRead($skill5))
Sleep(GuiCtrlRead($s5))


$coord = PixelSearch(584, 273, 952, 600, 0x7F7F7F, 4)
If Not @error Then
MouseClickDrag("left", $coord[0], $coord[1], $coord[0] + 60, $coord[1] + 60)
EndIf
sleep(300)
Send($skill1)
Send(GuiCtrlRead($skill1))
Sleep(GuiCtrlRead($s1))
Send(GuiCtrlRead($skill2))
Sleep(GuiCtrlRead($s2))
Send(GuiCtrlRead($skill3))
Sleep(GuiCtrlRead($s3))
Send(GuiCtrlRead($skill4))
Sleep(GuiCtrlRead($s4))
Send(GuiCtrlRead($skill5))
Sleep(GuiCtrlRead($s5))


$coord = PixelSearch(61, 434, 952, 600, 0x7F7F7F, 4)
If Not @error Then
MouseClickDrag("left", $coord[0], $coord[1], $coord[0] + 60, $coord[1] + 60)
EndIf
sleep(300)
Send(GuiCtrlRead($skill1))
Sleep(GuiCtrlRead($s1))
Send(GuiCtrlRead($skill2))
Sleep(GuiCtrlRead($s2))
Send(GuiCtrlRead($skill3))
Sleep(GuiCtrlRead($s3))
Send(GuiCtrlRead($skill4))
Sleep(GuiCtrlRead($s4))
Send(GuiCtrlRead($skill5))
Sleep(GuiCtrlRead($s5))


$coord = PixelSearch(50, 106, 415, 600, 0x7F7F7F, 4)
If Not @error Then
MouseClickDrag("left", $coord[0], $coord[1], $coord[0] + 60, $coord[1] + 60)
EndIf
sleep(300)
Send(GuiCtrlRead($skill1))
Sleep(GuiCtrlRead($s1))
Send(GuiCtrlRead($skill2))
Sleep(GuiCtrlRead($s2))
Send(GuiCtrlRead($skill3))
Sleep(GuiCtrlRead($s3))
Send(GuiCtrlRead($skill4))
Sleep(GuiCtrlRead($s4))
Send(GuiCtrlRead($skill5))
Sleep(GuiCtrlRead($s5))

WEnd

How can you tell that it doesn't try the other PixelSearch() functions? You don't have it do anything if it doesn't find the pixel, so if the color isn't found in that given area, nothing will happen, and it will just move on to the next portion of the code, which are all identical Send() and Sleep() functions.

You should also consider modulating your code. Put repeated code into a function and call that instead of copying/pasting the same thing over and over again. Variables that will remain the same (your $skill values) should be read into Global variables to decrease processing time.

These aren't major issues in your current code now, but as your code expands it could become a problem, and good coding practices are always best to learn early. Commenting code also helps a lot if you ever plan to return to it at a later date, and especially if you don't plan to return (that's when you forget what you were doing!).

Also

While 1=1

Should be

While 1

if you are intending to create an infinite loop. 1=1 may work (didn't try it), but that isn't how it was intended.

Edited by Affe

[center][/center]

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...