Sign in to follow this  
Followers 0
EricBBB

Am i messing up on my array assignments?

6 posts in this topic

Im using the mousegetpos command in one script to write these lines into another script. And it says it expects a = in my assignment as the error that pops up when i try to execute the file. Anyway this is how the storage file looks:

$mission[0] = 288

$mission[1] = 207

$butt1[0] = 575

$butt1[1] = 785

Share this post


Link to post
Share on other sites



Could we see some script? :)

Share this post


Link to post
Share on other sites

Could we see some script? :)

Eh, i guess ill take a chance and hope that whoever looks at this thread only looks at the script and not what its for.

#include "C:\Program Files\Wobot\Wobotfunc.au3"
If Not WinActive( "unknown game") Then WinActivate( "xxxxxxx")
WinWaitActive( "xxxxxxx")
HotKeySet("k", "myfunc")
$a = 1
While $a == 1 
$l = 1
$bprep1 = 0
$lvclr = 0
$bprep0 = 0
$ctclr = 0
Sleep (2000)
send("x")
sleep(1000)
MouseClick("left",  $mission[0], $mission[1], 3);                                               Enter mission
sleep(500)
MouseClick("left",  $mission[0], $mission[1], 3);                                               
sleep(20500)
$lvclr = pixelgetcolor ($leavemission[0], $leavemission[1])  ;                                    Get failed mission color
sleep(100)
$bprep1 = pixelgetcolor(98, 110);                                       Get battle prep ON color
sleep(100)
dontstartyet($bprep1, $bprep0)
MouseClick("left",  930,  70);                                              Head towards point A
sleep(1000)
send("{ctrlup}{alt up}{shiftup}")
sleep(100)
send("n")
sleep(100)
send("n")
sleep(100)
send("4");                                                                   Sail Focus
Sleep(18000);                                                               Sail for 45 seconds no combat yet
Send("{CTRLDOWN}")
MouseClick("left",  $butt1[0], $butt1[1]);                                              Activate Auto Fire
Sleep(100)
Send("{CTRLUP}")
sleep(100)
send("2");                                                                   Gunnery
Sleep(1000)
send("{CTRLDOWN}")
sleep(100)
Mouseclick("left",  $butt2[0], $butt2[1]);                                              Activate Hasty Fire
sleep(200)
Mouseclick("left",  $butt3[0], $butt3[1]);                                              Activate Extra Rations
sleep(200)
send("{CTRLUP}")
sleep(100)
For $I = 1 to 60 step 1;                                                                    Begin Firing!
Send("{TAB}")
Sleep(250)
next 
sleep(100)
MouseClick("left",  164,  518)
sleep(100)
Arewedoneyet($lvclr, $ctclr)
Wend 

i have some other files but thats the main file and my functions file is: $l = 1
#include <C:\Program Files\Wobot\botfil.au3>
    
Func dontstartyet($bprep1, $bprep0)
$bprep0 = PixelGetColor(98, 110)
sleep(100)
if $bprep0 == $bprep1 Then;                              If on, keep waiting.
sleep(500)
dontstartyet($bprep1, $bprep0)
EndIf
EndFunc

Func Arewedoneyet($lvclr, $ctclr)
$ctclr = pixelgetcolor ($leavemission[0],$leavemission[1])
if $ctclr == $lvclr Then
healthcheck()
else
send ("{TAB}")
sleep(250)
Arewedoneyet($lvclr, $ctclr)
EndIf
EndFunc

Func healthcheck()
$l = $l + 1
sleep(100)
send("{TAB}")
$ddf = @error
sleep (100)
pixelsearch (53, 70, 60, 80, 000000, 20, 1)
$ddf = @error
if $ddf = 0 or $l == 1500 then
MouseClick( "left",  $loot[0], $loot[1],5)
MouseClick( "left",  $claimall[0], $claimall[1],5)
MouseClick( "left",  $leavemission[0], $leavemission[1], 5)
MouseClick( "left",  $replaymission[0], $replaymission[1], 4)   
MouseClick( "left",  $loot[0], $loot[1],5)
Sleep(100)
MouseClick( "left",  $claimall[0], $claimall[1],5)
Sleep(100)
MouseClick( "left",  $leavemission[0], $leavemission[1], 5)
Sleep(100)
MouseClick( "left",  $replaymission[0], $replaymission[1], 4)
Sleep(100)
MouseClick( "left",  $loot[0], $loot[1],5)
Else
healthcheck()
EndIf
Endfunc

Func myfunc ()
    exit
    EndFunc

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I don't see where your getting $mission[0], $mission[1], there is none of that? O.o

EDIT: your not declaring these arrays before you use them... :)

Edited by R6V2

Share this post


Link to post
Share on other sites

I don't see where your getting $mission[0], $mission[1], there is none of that? O.o

Oh, sorry I have a setup file that tells the user to hover there mouse over an area and wait for the next msg box to come up. So they put their mouse where they want the coordinates for $mission to be stored and after sleep(10000) it does the mousegetpos and writes the $mission coordinates into a storage / config file here ill post it

$mission = 0
$butt1 = 0
$butt2 = 0
$butt3 = 0
$loot = 0
$claimall = 0
$leavemission = 0
$replaymission = 0
    Func missionget($mission)
    msgbox (0, "x", "Speak to coxswain, over mouse over the mission and wait, do not enter mission yet." )
    winactivate ( "Pirxxxxx") 
    WinWaitActive( "xtexxxxx0")
    sleep(10000)
    $mission = mousegetpos()
    fileopen ("c:\Program Files\Wobot\Botfil.au3", 9)
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$mission[0] = " & $mission[0] & @crlf)
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$mission[1] = " & $mission[1] & @crlf)  
    fileclose ("c:\Program Files\Wobot\Botfil.au3")
    sleep(500)
    send ( "{ALT Down} {TAB down} {ALT UP} {TAB UP}" )
    msgbox (0,"Jew", "Your mission coords are  " & $mission[0] & ", " & $mission[1])
EndFunc
Func usergetbutt1($butt1)
    msgbox (0, "x", "Enter mission first, then come back and click 'ok' then mouse over first skill/button you want to be ctrl clicked.")
    If Not WinActive( "xxxxxx") Then WinActivate( "xxxxxxxxxxx")
    WinWaitActive( "Pxxxxx0")
    sleep(10000)
    $butt1 = mousegetpos()
    fileopen ("c:\Program Files\Wobot\Botfil.au3", 9)
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$butt1[0] = " & $butt1[0]  & @crlf) 
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$butt1[1] = " & $butt1[1]  & @crlf)
    fileclose ("c:\Program Files\Wobot\Botfil.au3")
    sleep(500)
    send ( "{ALT Down} {TAB down} {ALT UP} {TAB UP}" )
    msgbox (0, "x", "Your first button was located at " & $butt1[0] & " " & $butt1[1])
EndFunc

Func usergetbutt2($butt2)
    msgbox (0, "Fxxxs","After you click ok, place your mouse over your second skill and or attack button that you want to ctrl click and wait. You have 10 seconds.")
    If Not WinActive( "xxxxxxxxx") Then WinActivate( "xxxxxxx")
    WinWaitActive( "xxxxxxxxx")
    sleep(10000)
    $butt2 = mousegetpos()
    fileopen ("c:\Program Files\Wobot\Botfil.au3", 9)
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$butt2[0] = " & $butt2[0]  & @crlf) 
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$butt2[1] = " & $butt2[1]  & @crlf) 
    fileclose ("c:\Program Files\Wobot\Botfil.au3")
    sleep(500)
    send ( "{ALT Down} {TAB down} {ALT UP} {TAB UP}" )
    msgbox (0, "JEW LOVER","Your second button was located at " & $butt2[0] & " " & $butt2[1])
EndFunc

Func usergetbutt3($butt3)
    msgbox (0,"x","After you click ok, place your mouse over your third skill and or attack button that you want to ctrl click and wait. You have 10 seconds.")
    If Not WinActive( "xxxxxxxx") Then WinActivate( "xxxxxx")
    WinWaitActive( "xxxxxxx")
    sleep(10000)
    $butt3 = mousegetpos()
    fileopen ("c:\Program Files\Wobot\Botfil.au3", 9)
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$butt3[0] = " & $butt3[0]  & @crlf) 
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$butt3[1] = " & $butt3[1]  & @crlf) 
    fileclose ("c:\Program Files\Wobot\Botfil.au3")
    sleep(500)
    send ( "{ALT Down} {TAB down} {ALT UP} {TAB UP}" )
    msgbox (0, "FAG", "Your third button was located at " & $butt3[0] &" " & $butt3[1])
endfunc

Func lootreplay()
    msgbox (0, "x","After you click ok, kill some npcs so that you can loot. After the mission fails, alt tab and click ok" )
    msgbox (0, "Delicate or sera didnt make this","Now, hold your mouse over the loot button next to your radar until you are brought back to this screen")
    sleep (100)
    If Not WinActive( "xxxxxxxx") Then WinActivate( "xxxxxxxxxx")
    WinWaitActive( "xxxxxxxxx")
    sleep(10000)
    $loot = mousegetpos()
    fileopen ("c:\Program Files\Wobot\Botfil.au3", 9)
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$loot[0] = " & $loot[0]  & @crlf) 
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$loot[1] = " & $loot[1]  & @crlf) 
    msgbox (0, "Sex","Now, hold your mouse over the claim all, or discard all button next to your radar until you are brought back to this screen")
    sleep (100)
    If Not WinActive( "xxxxxxxxxxxxxx") Then WinActivate( "xxxxxxxxxxxx")
    WinWaitActive( "xxxxxxxxxxxxx")
    sleep(10000)
    $claimall = mousegetpos()
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$claimall[0] = " & $claimall[0]  & @crlf) 
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$claimall[1] = " & $claimall[1]  & @crlf) 
    msgbox (0, "Dex x, seriously","Now, hold your mouse over the exit button next to your radar until you are brought back to this screen")
    sleep (100)
    If Not WinActive( "xxxxxxxxx") Then WinActivate( "xxxxxxx")
    WinWaitActive( "xxxxxxxxx")
    sleep(10000)
    $leavemission = mousegetpos()
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$leavemission[0] = " & $leavemission[0]  & @crlf) 
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$leavemission[1] = " & $leavemission[1]  & @crlf)
    msgbox (0, "Beach xvolleyball?", "Now, hold your mouse over the replay mission button next to your radar until you are brought back to this screen")
    sleep (100)
    If Not WinActive( "xxxxxxxx") Then WinActivate( "xxxxxxxxxxxx")
    WinWaitActive( "xxxxxxxxxxxxxxxxxxxxx")
    sleep(10000)
    $replaymission = mousegetpos()
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$replaymission[0] = " & $replaymission[0]  & @crlf) 
    filewriteline("c:\Program Files\Wobot\Botfil.au3", "$replaymission[1] = " & $replaymission[1]  & @crlf) 
    fileclose ("c:\Program Files\Wobot\Botfil.au3")
    sleep(500)
    msgbox (0, "Peace Jigga"," Congratulations set up is finished. For future reference just hit 'k' to end the bot. Enjoy!")
    endfunc
    
    
    missionget($mission)
    sleep( 100)
    usergetbutt1($butt1)
    sleep(100)
    usergetbutt2($butt2)
    sleep(100)
    usergetbutt3($butt3)
    sleep(100)
    lootreplay()

Share this post


Link to post
Share on other sites

If these are in the same file, then, try to Globalize the arrays your using, and try it again :)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0