Heffy
Junior Member
Posts: 62
|
Post by Heffy on Jan 26, 2005 5:57:06 GMT -5
I started making my first piece of FFACT work and it already doesnt work So here's my code: #include "FFXI_Helper.au3" Global $curemp; Global $mp; Global $mpmax; Global $status; Global $healing; $healing = 0 $curemp = 8 FFACT_Update(); $mp = FFACT_GetPlayerMP(); $mpmax = FFACT_GetPlayerMaxMP(); $status = FFACT_GetPlayerStatus(); WinWaitActive("FFXiApp") AutoItSetOption("SendKeyDelay", 0235); While 1 Sleep(7000) FFACT_Update(); If $healing == 0 Then If $mp < 8 Then Send("/heal{ENTER}") $healing = 1 EndIf Else If $mp == $mpmax Then Send("/heal{ENTER}") $healing = 0 Else If $healing == 0 Then Send("!2") EndIf EndIf EndIf WEnd The problem I'm having is that it casts until you can't cast no more, then it rests, but it won't stand back up. Or at least I think that's the problem, I messed with the script a few times and it might not even work now. But anyway, how can I make it stand back up after healing?
|
|
|
Post by TinyTerror on Jan 26, 2005 7:16:58 GMT -5
I'll step over this at work today. Its good to see scripts being made with FFACT.Its sooo much better than using pixel or hardcoded methods
|
|
Heffy
Junior Member
Posts: 62
|
Post by Heffy on Jan 26, 2005 7:50:40 GMT -5
That's why I intentionally waited till FFXI Helper was ready, I'd rather start with the new methods than the old and redundant methods.
|
|
|
Post by TinyTerror on Jan 26, 2005 8:26:27 GMT -5
Ok, I think I found the problem. In your loop, it doesnt look like you are ever calling FFACT_GetPlayerMP(); This means when you call FFACT_Update, you arent actually getting any new data into $mp. Try adding the line:
$mp = FFACT_GetPlayerMP();
after the FFACT_Update(); call in your loop. This might fix the problem. Let me know how it goes.
|
|
Heffy
Junior Member
Posts: 62
|
Post by Heffy on Jan 26, 2005 10:19:22 GMT -5
I redid the section that was annoying me, like so:
#include "FFXI_Helper.au3"
Global $mp; Global $mpmax; Global $curecost; $curecost = 8
WinWaitActive("FFXiApp") AutoItSetOption("SendKeyDelay", 0235);
While 1 == 1
Do
FFACT_Update(); $mp = FFACT_GetPlayerMP(); $mpmax = FFACT_GetPlayerMaxMP();
Sleep(7000)
Send("!2")
Until $mp < $curecost
Send("/heal{ENTER}") Do Sleep(10000) Send("!1") Until $mp == $mpmax
Send("/heal{ENTER}") Send("!3")
WEnd
But the problem still remains that the bot wont stand back up. I think its not reading the max mp properly for some reason, although in every other script it works fine. Any suggestions?
|
|
|
Post by TinyTerror on Jan 26, 2005 10:28:13 GMT -5
Inside your resting loop you have this code:
Do Sleep(10000) Send("!1") Until $mp == $mpmax
The problem here is that you are not refreshing $mp within this loop. So while your character's MP is full, your script is still running off of the old values. Try adding another ffact update and an mp update into this loop. Things should work then.
Also, what is the macro you are calling during the rest loop?
|
|
Heffy
Junior Member
Posts: 62
|
Post by Heffy on Jan 26, 2005 10:29:25 GMT -5
Just an echo that says resting. For debug purposes, you know, to find out where the bot is stopping.
|
|
|
Post by TinyTerror on Jan 26, 2005 10:31:43 GMT -5
Hmm. I would avoid using /echo commands if you can. GM's have the ability to see what is in your chat log. If you have a bunch of debug crap from your script there, they will see it and then the jig is up. This is why I added the extra debug window in Autoterror
|
|
Heffy
Junior Member
Posts: 62
|
Post by Heffy on Jan 26, 2005 10:38:49 GMT -5
The one problem with that debug window is it goes away after you close autoterror. Perhaps you should make it dump the contents to a txt file? And adding that extra update into the second loop fixed it. I should've realised this, but its early in the mornin and I'm tired thanks man.
|
|
|
Post by TinyTerror on Jan 26, 2005 10:39:47 GMT -5
No problem Yeah, adding a logger to the debug window might not be a bad idea at all. I'll look into it. Now that your bot seems to be working, would you mind if I add it to the list? There arent enough FFACT based scripts there, and I would like to see some more. Let me know what you think.
|
|
Heffy
Junior Member
Posts: 62
|
Post by Heffy on Jan 26, 2005 10:41:04 GMT -5
Oh and another feature I just thought of: timestamps! Not everyone finds them useful, but you can use them to find out when your bot stopped working etc...perhaps make another version of conOut that adds the time onto that line aswell?
|
|
|
Post by TinyTerror on Jan 26, 2005 10:41:52 GMT -5
Thats doable as well.
|
|
Heffy
Junior Member
Posts: 62
|
Post by Heffy on Jan 26, 2005 10:43:42 GMT -5
This is slowly turning into MSN, lol, time to start on my next bot.
|
|
|
Post by TinyTerror on Jan 26, 2005 10:45:29 GMT -5
$Postcount=$Postcount+1;
Please see my previous post about adding your script to the list.
|
|
Heffy
Junior Member
Posts: 62
|
Post by Heffy on Jan 26, 2005 10:47:23 GMT -5
Add it to the list if you want Although I think I should make some sort of readme for it first.
|
|