Jump to content

Scripting Help


Guest Steve
 Share

Recommended Posts

Guest Steve

Okay..I am trying to make an FFXI fishing bot, and I wanna make it so it will logout and log back in every fifty minutes. I have it so I can autosort, and change bait. I can't figure out how to do this :/. Any help would be greatly appreciated.

PS. I don't know if the mods would like me to post the script on here. If it's okay then I will post what I have so far.

Thank you.

Link to comment
Share on other sites

  • Replies 80
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Guest Steve

Okay sorry I didn't know if it was okay to.

Heres what I have (NOTE: Not all my work. I got alot from http://www.rpgexpert.com/1997.html)

Sleep(100000);give time to open FFXI

$fisha = 2;

$event = 0;

$bite = 0;

$failsafe=0;

$nobait = 0;

WinWaitActive("FFXiApp");

While $fisha > 1

AutoItSetOption("SendKeyDelay", 40);

Send ("!1"); fishing macro

$event = 0;

$failsafe = 0;

$nobait = 0;

Do

Sleep(250);

If PixelGetColor(22,994) = 16777215 AND PixelGetColor(108,996) = 16777215 AND PixelGetColor(228,997) = 16777215 Then

AutoItSetOption("SendKeyDelay", 40);

Sleep(Random(3000,3200));

Send("{ENTER}");

Sleep(5400);

EndIf

If PixelGetColor(43,997) = 16777215 AND PixelGetColor(83,998) = 16777215 AND PixelGetColor(175,999) = 16777215 Then

Sleep(Random(5100,5400));You lost your catch. Finish and speed things up a little.

$event = 1;

EndIf

If PixelGetColor(37,1000) = 16777215 AND PixelGetColor(77,1000) = 16777215 AND PixelGetColor(180,998) = 16777215 Then

Sleep(Random(5100,5400));You didn't catch anything. Finish and speed things up a little.

$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.

EndIf

If PixelGetColor(43,995) = 16777215 AND PixelGetColor(71,997) = 16777215 AND PixelGetColor(84,995) = 16777215 Then

autosort()

Sleep(Random(2100,2200));

$event = 1;You caught something so now autosort, sleep a bit, and finish the event.

EndIf

$failsafe = $failsafe+1;

If $failsafe = 175 Then

$event = 1;

EndIf

Until $event = 1

sleep(2000);

If $nobait = 1 Then

Send("!2");change bait

EndIf

WEnd

Func autosort()

Sleep(9000);

AutoItSetOption("SendKeyDelay", 0235);

AutoItSetOption("SendKeyDownDelay", 0100);

Send ("!i");

Sleep(0250);

Send ("{NUMPADADD}");

Sleep (0250);

Send ("{ENTER}");

sleep(0350);

Send ("{UP}");

sleep(0350);

Send ("{ENTER}");

sleep(0250);

Send ("{ESCAPE}");

sleep(0250);

Send ("{ESCAPE}");

Sleep (0250);

EndFunc

That is what I have. It is for 1280 by 1024 res, and 512 by 512 background res.

Thank you

Link to comment
Share on other sites

Guest Steve

Sure Slim. To logout you can simply type /logout, and then theres a thrity second countdown then it takes you to a screen. When your at the screen you would probably have to make it so the script goes up enter, down enter, etc.

Is it possible to make it go up enter, down enter, etc?

I will go try it and type excatly how I do it. You can use all keyboard commands. I would assume you would have to pause the script to, and then when your back in to resume it.

Thanks for the offer :D , I will see what keys you do to log out now.

Tell me if what I said would work.

Link to comment
Share on other sites

Guest Steve

Okay heres what I have:

Logout:

1. You can type /logout to logout.

OR

2. Press the - key (The one the right numberpad, not the one by Backspace)

Press the -> arrow key

Press Enter

Press the <- arrow key

Press Enter

Both ways log you out. I don't know if you can just use /logout. After you do either process it gives a 30 second countdown.

Now your at a screen.

Logging In:

There is only one way to do this. It's enter, enter, enter.

Then your back in the game at the same spot.

Anyway you could implement that into the current code I have?

Thank you.

Link to comment
Share on other sites

Guest Guest

Okay sorry, but jsut to clarify I put "I don't know if you can just use /logout", I meant I don't know if you need to know how to do it on the keyboard or not. You can just type /logout and then the thirty second countdown will start.

Link to comment
Share on other sites

Guest Guest

Yes, I have. You don't have to be a dick about it. Just chill out. I don't understand and I'm asking for a little help.

Link to comment
Share on other sites

Valik may be blunt, but he's not being a dick about this. You would have had to been around when the gaming forum was open to understand the feelings toward fishing bots. He's just trying to get people to read the help file and he is right ... sending keys is the first and easiest thing to do with Autoit.

And on a side note you could set a hotkey to login and/or logout.

Edited by psichosis

We have enough youth. How about a fountain of SMART?

Link to comment
Share on other sites

Guest Steve

A hotkey you say? Okay where at in the manual is this about sending keys? I read it again and I didn't see anything about it.

Link to comment
Share on other sites

Finding out what part you didn't understand could help us figure out how to help at this point. If all you have to do is type logout or /logout then this is what you would send with the send command

Send("/logout")
Sleep(30000);wait 30 seconds before continuing
Send("{RIGHT}")
Send("{ENTER}")
Send("{LEFT}")
Send("{ENTER}")

Just have this happen every 50 minutes if I am understanding you correctly

The Send command is in the help file under Function Reference>Keyboard Control

Oh ... and you can go to the index in the help file and type the command you are looking for and it will find it for you

We have enough youth. How about a fountain of SMART?

Link to comment
Share on other sites

Guest Guest

Okay, I am starting to get it. I fixed the code a little bit in order to make it log in and out. Now the only thing I have to ask is how would I make it so that every 50 minutes it logs out and then loops?

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

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

Do 
Sleep(250); 

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

If PixelGetColor(43,997) = 16777215 AND PixelGetColor(83,998) = 16777215 AND PixelGetColor(175,999) = 16777215 Then 
Sleep(Random(5100,5400));You lost your catch. Finish and speed things up a little. 
$event = 1; 
EndIf 

If PixelGetColor(37,1000) = 16777215 AND PixelGetColor(77,1000) = 16777215 AND PixelGetColor(180,998) = 16777215 Then 
Sleep(Random(5100,5400));You didn't catch anything. Finish and speed things up a little. 
$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. 
EndIf 

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


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

Until $event = 1 

sleep(2000); 

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

WEnd 

Func autosort() 
Sleep(9000); 
AutoItSetOption("SendKeyDelay", 0235); 
AutoItSetOption("SendKeyDownDelay", 0100); 
Send ("!i"); 
Sleep(0250); 
Send ("{NUMPADADD}"); 
Sleep (0250); 
Send ("{ENTER}"); 
sleep(0350); 
Send ("{UP}"); 
sleep(0350); 
Send ("{ENTER}"); 
sleep(0250); 
Send ("{ESCAPE}"); 
sleep(0250); 
Send ("{ESCAPE}"); 
Sleep (0250);
Send("/logout")
Sleep(30000);wait 30 seconds before continuing
Send("{ENTER}");
Send("{ENTER}");
Send("{ENTER}");
EndFunc

I put it at the end there, Is that the right place?

Link to comment
Share on other sites

how would I make it so that every 50 minutes it logs out and then loops?

To repeat code every 50 minutes, use:

While 1;infinate loop
;put your code that you wish to do here
;for example, your /login... etc etc
;...
;...
  Sleep(3000 * 1000);sleep 50 minutes: 50 * 60 * 1000 for the ms required)
WEnd

If you use that, you'll want a way to exit the function, such as a hotkey. Just define somthing, like F10 (or whatever) to break out of the loop:

HotKeySet("{F10}", "Escape");put this before your while loop

;other code here, as required

Func Escape()
  MsgBox(0, "you hit the F10 Key", "now exiting...")
  Exit
EndFunc

Edited to add the quote at the top

Edit (2) to correct the HotKeySet function paramaters

Edited by pekster

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

Guest Guest

Okay Thank you very much, but I have some questions.

;put your code that you wish to do here

;for example, your /login... etc etc

;...

;...

I don't understand that part. "put your code that you wish to do here". Would that be this part..

Sleep(30000);wait 30 seconds before continuing
Send("{RIGHT}");
Send("{ENTER}");
Send("{LEFT}");
Send("{ENTER}");

Also where would I put that in my script?

Link to comment
Share on other sites

Guest Guest

Sorry I mean I forgot one part. Would it be this:

Send("/logout")

Sleep(30000);wait 30 seconds before continuing

Send("{ENTER}");

Send("{ENTER}");

Send("{ENTER}");

?

Thanks for the help.

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...