sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Nov 26, 2005 13:24:57 GMT -5
I wrote this after watching so many people keep '/heal' on after HP and MP have been filled while their TP still continues to decrease each healing tick after. I wrote this script to end '/heal' when HP and MP are full, saving TP in the process.
Windower.console_Write("TP Save") Windower.console_Write(" Written by Zytre")
while true do maxHP=FFXI.player_GetMaxHP() maxMP=FFXI.player_GetMaxMP()
if FFXI.player_GetStatus()==33 and FFXI.player_GetCurrentHP()==maxHP and FFXI.player_GetCurrentMP()==maxMP then Control.control_SendString("/heal") while FFXI.player_GetStatus()==33 do Windower.script_Sleep(100) end end
Windower.script_Sleep(100) end
|
|
petar113507
Full Member
Damn Straight. I Am the king of waffelagia.
Posts: 166
|
Post by petar113507 on Nov 27, 2005 1:21:48 GMT -5
Interesting, I beleive I could partake in using this... ^_^
One question with this though, would the center loop get 'stuck' or never hit? I think it would either or.... I mean, Just a little thought with this, you technically break the loop before you start it here, you get outta /heal with the last string, or if there is a lag or somehow the string is not registered, you would have to break manually.... >.>
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Nov 27, 2005 16:52:04 GMT -5
Interesting, I beleive I could partake in using this... ^_^ One question with this though, would the center loop get 'stuck' or never hit? I think it would either or.... I mean, Just a little thought with this, you technically break the loop before you start it here, you get outta /heal with the last string, or if there is a lag or somehow the string is not registered, you would have to break manually.... >.> What happens is when the conditions are met, the script sends '/heal' to FFXI to get back up. The loop afterward is to halt execution until FFXI acknowledges the command so the script doesn't flood FFXI with the '/heal' command. Remember: while <condition> do will loop until <condition> is not met.
|
|
|
Post by TinyTerror on Nov 28, 2005 9:26:29 GMT -5
Good idea.
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Nov 28, 2005 22:37:12 GMT -5
Thx ^^ I write these scripts to work with the least communication to the FFXI command interpreter as possible to minimize the possibility of detection. I try to combine function with the best stealth possible. I may change the code to break '/heal' by movement keystroke instead of command to increase code stealth. I'm not sure about the difference, but I use the movement keys to break '/heal' rather than typing the command or using a macro under usual playing conditions. Anything that duplicates what the user normally does would make the program theoretically untracible.
|
|
|
Post by DarkAquaus on Dec 1, 2005 18:52:23 GMT -5
as long as u look at ffxi's memmory space it is detectable
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Dec 2, 2005 4:27:15 GMT -5
as long as u look at ffxi's memmory space it is detectable Nothing can detect memory reading theoretically. The thing that gets you is any output to FFXI you do (output through the FFXI command interpreter or keystrokes). Trying to match what the player would usually do would effectly confuse anything trying to identify the script running as a program versus an actual user. True, just looking tracable, but some scripts need to tell FFXI what to do. That's where the challenge of stealth comes in.
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Dec 3, 2005 4:34:56 GMT -5
Simple script, but one major bug. Since it can't detect if you're logging out, it is possible for the script to keep canceling any of the logout commands, so be sure to unload it before you try to get out of FFXI.
|
|
|
Post by dirtytofu on Dec 14, 2005 23:00:22 GMT -5
Hmm... I thought TP doesn't decrease if both HP and MP are full.
|
|
|
Post by DarkAquaus on Dec 15, 2005 14:42:21 GMT -5
no it still does aslong as u are in the heal possition it will continue until 0% is reached
|
|
nebula
Junior Member
fear.
Posts: 59
|
Post by nebula on Dec 18, 2005 0:12:39 GMT -5
Simple script, but one major bug. Since it can't detect if you're logging out, it is possible for the script to keep canceling any of the logout commands, so be sure to unload it before you try to get out of FFXI. add this function function checkLogout() local LineNumber = FFXI.chat_GetNewestLineNumber() local LineType = FFXI.chat_GetLineType(LineNumber) if LineType == "88" then return true else return false end end
then in the if, you should check for logout then sleep the script for 30 seconds or break out of the while (killing the script) here's what i ended up with after modifying your code while true do HP, MP = FFXI.player_GetCurrentHP(), FFXI.player_GetCurrentMP() MaxHP, MaxMP = FFXI.player_GetMaxHP(), FFXI.player_GetMaxMP() if FFXI.player_GetStatus()==33 and HP==MaxHP and MP==MaxMP then if checkLogout() then Windower.script_Sleep(30000) else Control.control_SendString("/heal off") repeat Windower.script_Sleep(100) until FFXI.player_GetStatus() ~= 33 end end Windower.script_Sleep(100) end
nifty idea
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Dec 18, 2005 23:45:37 GMT -5
Ya, until the chat protion of Lunar becomes stable, I might start using that. Until then, I try to stay away from doing anything that would crash the game.
I haven't checked if there's a delay between the player status being set and the logout messages poping up.. I suspect there is, which makes exiting by chat messages unreliable.
Automation is nice, but there is a point where it can get annoying. Theoretically, this modification would work, but it might still cancel the first logout attempt if the script is left running.
If it was possible to intercept the FFXI command interpreter for the '/logout' or '/shutdown' commands, that would work better to trigger the script to end.
Something better with the modified code, is to let the script end itself rather than to just have it wait 30 secs and hope FFXI exited by then and have Lunar force the script to stop.
The old code would work if the new function was defined and the main loop was rewritten as
while not checkLogout() do instead of the usual
while true do This puts an ending condition to the main loop, making the script end itself when needed so Lunar doesn't have to bother forcing it to unload.
The origional code is pretty good for being only 12 lines of actual code and taking only a minute from idea to functional script.
|
|
nebula
Junior Member
fear.
Posts: 59
|
Post by nebula on Dec 19, 2005 5:01:51 GMT -5
its pretty immediate, heh, i use that code myself and never got kicked out when i shouldn't have, and i didn't have it kill it because sometimes you're jes muling and don't wanna unload the script (ie lazy) If it was possible to intercept the FFXI command interpreter for the '/logout' or '/shutdown' commands, that would work better to trigger the script to end. i think this will happen with next version on windower, i remember see talk of intercepting things like <tnl> in pt chat and replacing it with your actual tnl, don't see why it would be any different to catch other things, assuming you don't use the menu to log
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Dec 21, 2005 17:43:39 GMT -5
Heh, still bugs me with the 30 sec wait after logout detection.. Maybe go inactive when you logout then back active when the area information pops up in chat. That would take care of lag during logout.
|
|