Jump to content

Error in code.. cant tell why


Recommended Posts

can someone tell me why this dosent work?

it says "until $event = 1 statement w/o matching do statement", but i have the matching do statement in it

Sleep(100000);give time to open FFXI 
$fisha = 2; 
$event = 0; 
$failsafe=0; 
$nobait = 0; 
$Drop = 0;
WinWaitActive("FFXiApp"); 

While $fisha > 1 
AutoItSetOption("SendKeyDelay", 40); 
HotKeySet("{F10}", "TogglePause")
Send ("^1"); fishing macro 
$event = 0; 
$failsafe = 0; 
$nobait = 0; 

Do 
Sleep(050); 

If PixelGetColor(24,1000) = 16777215 AND PixelGetColor(127,997) = 16777215 AND PixelGetColor(507,995) = 16777215 Then
Sleep(3000);
$event = 1; You're catch was too small
endif

If PixelGetColor(33,997) = 16777215 AND PixelGetColor(142,999) = 16777215 AND PixelGetColor(347,1000) = 16777215 Then
send("{^2}");You can't fish without a rod
end if

If PixelGetColor(51,996) = 16777215 AND PixelGetColor(86,997) = 16777215 AND PixelGetColor(99,991) = 16777215 Then
$nobait = 1;You're line broke
$event = 1
end if

If PixelGetColor(33,998) = 16777215 AND PixelGetColor(64,996) = 16777215 AND PixelGetColor(122,997) = 16777215 Then
send("{^2}");You're Rod Broke
endif

If PixelGetColor(22,994) = 16777215 AND PixelGetColor(108,996) = 16777215 AND PixelGetColor(228,997) = 16777215 Then 
AutoItSetOption("SendKeyDelay", 40); 
Send("{ENTER}");
Sleep(0500); 
EndIf 

If PixelGetColor(43,997) = 16777215 AND PixelGetColor(83,998) = 16777215 AND PixelGetColor(175,999) = 16777215 Then 
Sleep(3000);You lost your catch.
$event = 1; 
EndIf 

If PixelGetColor(37,1000) = 16777215 AND PixelGetColor(77,1000) = 16777215 AND PixelGetColor(180,998) = 16777215 Then 
Sleep(3000);You didn't catch anything.
$event = 1; 
EndIf 

If PixelGetColor(47,1000) = 16777215 AND PixelGetColor(142,999) = 16777215 AND PixelGetColor(330,997) = 16777215 Then 
$nobait = 1;You ran out of bait so let's get ready to change it. 
$event = 1
EndIf 

$drop = 0
If PixelGetColor(101,997) = 1834837 AND PixelGetColor(101,998) = 1834837 AND PixelGetColor(101,994) = 1834837 and $drop = 0 Then
Sleep(8500); 
autodrop()
$event = 1;You Got A Rusty Item, So Drop It... If you don't want it to drop the item, change the line that says "$drop = 0" just above the line that starts 

with "If PixelGetColor(101,997) = 1834837" to "$drop = 1"
end if

If PixelGetColor(43,995) = 16777215 AND PixelGetColor(71,997) = 16777215 AND PixelGetColor(84,995) = 16777215 Then 
Sleep(8500); 
autosort() 
$event = 1;You caught something so now autosort, sleep a bit, and finish the event. 
EndIf 

$failsafe = $failsafe+1; 
If $failsafe = 500 Then 
$event = 1; 
EndIf 

Until $event = 1 

If $nobait = 1 Then 
Send("!^3");change bait 
EndIf 

WEnd 

Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
WEnd
EndFunc

Func autosort() 
AutoItSetOption("SendKeyDelay", 0235); 
AutoItSetOption("SendKeyDownDelay", 0100); 
Send ("^i"); 
Sleep(0100); 
Send ("{NUMPADADD}"); 
Sleep (0100); 
Send ("{ENTER}"); 
sleep(0100); 
Send ("{UP}"); 
sleep(0100); 
Send ("{ENTER}"); 
sleep(0100); 
Send ("{ESCAPE}"); 
sleep(0100); 
Send ("{ESCAPE}"); 
Sleep (500); 
EndFunc

func autodrop()
AutoItSetOption("SendKeyDelay", 0235); 
AutoItSetOption("SendKeyDownDelay", 0100); 
Send ("^i"); 
Sleep(0100); 
send ("{RIGHT}")
Sleep(0100); 
send ("{ENTER}")
Sleep(0100); 
send ("{UP}")
Sleep(0100); 
send ("{ENTER}")
Sleep(0100); 
send ("{ESCAPE}")
Sleep(0100); 
send ("{ESCAPE}")
Sleep(0500); 
endfunc
Edited by eatnumber1
Link to comment
Share on other sites

i fixed the endif that was misspelled, but is still gives the same error... what do i do?

heres the code

Sleep(100000);give time to open FFXI 
$fisha = 2; 
$event = 0; 
$bite = 0; 
$failsafe=0; 
$nobait = 0; 
$Drop = 0;
WinWaitActive("FFXiApp"); 

While $fisha > 1 
AutoItSetOption("SendKeyDelay", 40); 
HotKeySet("{F10}", "TogglePause")
Send ("!1"); fishing macro 
$event = 0; 
$failsafe = 0; 
$nobait = 0; 

Do 
Sleep(050); 

If PixelGetColor(22,994) = 16777215 AND PixelGetColor(108,996) = 16777215 AND PixelGetColor(228,997) = 16777215 Then 
AutoItSetOption("SendKeyDelay", 40); 
Send("{ENTER}"); 
Sleep(0500); 
EndIf 

If PixelGetColor(43,997) = 16777215 AND PixelGetColor(83,998) = 16777215 AND PixelGetColor(175,999) = 16777215 Then 
Sleep(3000);You lost your catch.
$event = 1; 
EndIf 

If PixelGetColor(37,1000) = 16777215 AND PixelGetColor(77,1000) = 16777215 AND PixelGetColor(180,998) = 16777215 Then 
Sleep(3000);You didn't catch anything.
$event = 1; 
EndIf 

If PixelGetColor(47,1000) = 16777215 AND PixelGetColor(142,999) = 16777215 AND PixelGetColor(330,997) = 16777215 Then 
$nobait = 1;You ran out of bait so let's get ready to change it. 
$event = 1
EndIf 

$drop = 0
If PixelGetColor(101,997) = 1834837 AND PixelGetColor(101,998) = 1834837 AND PixelGetColor(101,994) = 1834837 and $drop = 0 Then
Sleep(8500); 
autodrop()
$event = 1;You Got A Rusty Item, So Drop It... If you don't want it to drop the item, change the line that says "$drop = 0" just above the line that starts 

with "If PixelGetColor(101,997) = 1834837" to "$drop = 1"
EndIf

If PixelGetColor(43,995) = 16777215 AND PixelGetColor(71,997) = 16777215 AND PixelGetColor(84,995) = 16777215 Then 
Sleep(8500); 
autosort() 
$event = 1;You caught something so now autosort, sleep a bit, and finish the event. 
EndIf 

$failsafe = $failsafe+1; 
If $failsafe = 500 Then 
$event = 1; 
EndIf 
do
Until $event = 1 

If $nobait = 1 Then 
Send("!2");change bait 
EndIf 

WEnd

Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
WEnd
EndFunc

Func autosort() 
AutoItSetOption("SendKeyDelay", 0235); 
AutoItSetOption("SendKeyDownDelay", 0100); 
Send ("^i"); 
Sleep(0100); 
Send ("{NUMPADADD}"); 
Sleep (0100); 
Send ("{ENTER}"); 
sleep(0100); 
Send ("{UP}"); 
sleep(0100); 
Send ("{ENTER}"); 
sleep(0100); 
Send ("{ESCAPE}"); 
sleep(0100); 
Send ("{ESCAPE}"); 
Sleep (500); 
EndFunc

Func autodrop()
AutoItSetOption("SendKeyDelay", 0235); 
AutoItSetOption("SendKeyDownDelay", 0100); 
Send ("^i"); 
Sleep(0100); 
send ("{RIGHT}")
Sleep(0100); 
send ("{ENTER}")
Sleep(0100); 
send ("{UP}")
Sleep(0100); 
send ("{ENTER}")
Sleep(0100); 
send ("{ESCAPE}")
Sleep(0100); 
send ("{ESCAPE}")
Sleep(0500); 
Endfunc
Link to comment
Share on other sites

  • 2 months later...
Guest awfullysuave

So could someone post the new code? I fail to see the erroneous statement that you're talking about. I've been trying to design my own code for a while & I keep having trouble with my own code because it autosorts instead of autodropping a rusty since it still detects it obtains an item... Thanks, sorrry for bringing up more ffxi =/

Link to comment
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
 Share

  • Recently Browsing   0 members

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