gaz
New Member
Posts: 27
|
Post by gaz on Feb 27, 2006 5:34:16 GMT -5
I want to make a script that will read in the chat line checking for battle targets which are about to use a special ability.
As soon as the line is read it will automatically cast stun.
E.G. Goblin Leacher readies bomb toss. Player Casts Stun.
However, what I want is for this to work for all the different mob abiltys. Is there a way to do a check against chat lines with an array of all the mob abilitys (perhaps in a text file).
EDIT: For anyone who is intrested; here's the latest version, thank you sdphantom.
(Untested)
Windower.console_Write('Auto Stun Activated') ability = { "Bomb Toss", "Self%-Destruct", "Meltdown", "Nightmare", "Cure", "aga", "oga", "Freeze", "Tornado", "Quake", "Flood", "Burst", "Flare"}
chatPos=FFXI.chat_GetOldestLineNumber() function chatPop() if FFXI.chat_GetNewestLineNumber()>chatPos then chatPos=chatPos+1 return FFXI.chat_GetLineType(chatPos),FFXI.chat_GetLine(chatPos) else return nil,nil end end
lastCast=0
while true do local target=FFXI.target_GetName() local chatCode,chatLine=chatPop()
if (chatCode=="64" or chatCode=="3b") and (os.clock()-lastCast)>(45+3) and target~="" then for i,j in ipairs(ability) do if string.find(chatLine,target..".+"..j) then Control.control_SendString("/ma Stun <t>") Control.control_SendString("/echo Stun") lastCast=os.clock() break end end end end
|
|
gaz
New Member
Posts: 27
|
Post by gaz on Feb 27, 2006 7:07:01 GMT -5
Would something like this work?
Windower.console_Write('Auto Stun Activated') abilitys = { "Bomb Toss", "Nightmare", "Goblin Rush", "Cure III", "Aeroga", "Aeroga II", "Aeroga III"} --etc i=0
while true do currentline=FFXI.chat_GetNewestLineNumber() chatline=FFXI.chat_GetLine(CurrentLine) target=target_GetName() while i < count(abilitys) do if Chatline == (target..(" Readies " or " Starts Casting ")..abilitys[i]..".")( then Control.control_SendString("/ma Stun <bt>") end i++ end i=0 end
Feel free to amend.
|
|
|
Post by TinyTerror on Feb 27, 2006 7:55:03 GMT -5
Something like that.
|
|
gaz
New Member
Posts: 27
|
Post by gaz on Feb 27, 2006 8:06:37 GMT -5
I cant test, my drk isnt 37 yet hehe I think this would be usefull tho, especially against diablos... Anyone have any idea where i can get a full mob special ability listing from, Like bomb toss and stuff? Also, i dont know about arrays/lists in perl and getting there length, can count be used? i duno ^^
|
|
dev
New Member
Posts: 20
|
Post by dev on Feb 27, 2006 10:36:56 GMT -5
belive me, on things like stun, player skill will be allways > scripts
actually auto stun is pretty lame
|
|
gaz
New Member
Posts: 27
|
Post by gaz on Feb 27, 2006 10:53:21 GMT -5
Why? I'm sorry... but a well written script will always be faster than HCI, and it does'nt make mistakes.
Anyway, here's it updated if somebody can check it for me.
Windower.console_Write('Auto Stun Activated') Ability = { "Bomb Toss", "Nightmare", "Goblin Rush", "Cure III", "Aeroga", "Aeroga II", "Aeroga III"} --etc
while true do Chat={} LineNumber={} PatternCheck={} Target=target_GetName() for i=1,3,1 do --checks last 3 chat lines for a=1,table.getn(Ability),1 do --checks abilitys from the list LineNumber[i]=FFXI.chat_GetNewestLineNumber()-(i-1) Chat[i]=FFXI.chat_GetLine(LineNumber[i]) PatternCheck[i]=string.find(Chat[i],(Target..(" Readies " or " Starts Casting ")..Ability[a]..".")) if PatternCheck[i]~=nil then --if the partern check returns something cast stun Control.control_SendString("/ma Stun <bt>") end end end end
I'm working on a list of mob skills, I've got about 200 so far... I dont know how quick the script will run as i am unfamiliar with perl, but it should be under a second even with arrays of length 500+ (as i did a python script not long ago with about 700 vertices and it was still fast).
|
|
|
Post by TinyTerror on Feb 27, 2006 14:15:12 GMT -5
This is sort of a gray area. I don't really like scripts that do this kind of thing, but I'm not going to move against them because they aren't really bots.
|
|
Sufo
New Member
Extreme Web Designer and Scripter
Posts: 48
|
Post by Sufo on Feb 27, 2006 15:38:39 GMT -5
It could be known as a bot. It's doing an action without the player doing it themselves......i havent seen anything like this on the site yet myself. So why shouldnt it be claimed as a bot?
|
|
|
Post by TinyTerror on Feb 27, 2006 15:42:05 GMT -5
Its not a bot because it is being used while the player is playing. Bots are unattended.
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Feb 27, 2006 15:52:20 GMT -5
This is known as a helper script. It performs part of the work while allowing the player to concentrate more on the rest.
|
|
imk
New Member
madness?
Posts: 13
|
Post by imk on Feb 27, 2006 16:57:32 GMT -5
i have a neutral feeling about this one... if he wants to use this, then thats up to him... im not going to use it, you dont have to use it... if you dont like it, dont read it or use it
|
|
gaz
New Member
Posts: 27
|
Post by gaz on Feb 27, 2006 17:47:51 GMT -5
Yeah, I'd class this as an assist... or i wouldnt be trying to do it.
I rarely see a drk or blm actually stun a devastating ability, as its usually to hard to see through the clutter of attacks, chats and spells. So it would be nice if this works (it will make you popular in partys)!
Also, for those of you who have tried diablos i dont need to explain the advantages of being able to instantly stun his Nightmare ability as he readies it. ^^
Update: I tried this and it causes windower to crash... Any ideas?
Windower.console_Write('Auto Stun Activated') Ability = { "Bomb Toss", "Nightmare", "Goblin Rush", "Cure III", "Aeroga", "Aeroga II", "Aeroga III"} --etc
while true do Chat={} LineNumber={} PatternCheck={} Target=FFXI.target_GetName() for i=1,3,1 do --checks last 3 chat lines for a=1,table.getn(Ability),1 do --checks abilitys from the list LineNumber[i]=FFXI.chat_GetNewestLineNumber()-(i-1) Chat[i]=FFXI.chat_GetLine(LineNumber[i]) PatternCheck[i]=string.find(Chat[i],(Target..(" Readies " or " Starts Casting ")..Ability[a]..".")) if PatternCheck[i]~=nil then --if the partern check returns something cast stun Control.control_SendString("/ma Stun <bt>") Control.control_SendString("/echo Stun") end end end end
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Feb 27, 2006 19:53:42 GMT -5
I've used stun JAs/WSs on a regular basis against bomb drops and most other abilities I can stop in time. I use Stun quite often as BLM (my DRK isn't high enough to use it yet), not only to stop mob abilities, but to also stop the mob from wandering too far when the tank loses hate or to buy casting time for sleep when I'm in the hot seat.
|
|
gaz
New Member
Posts: 27
|
Post by gaz on Feb 28, 2006 3:33:05 GMT -5
Yeah, it's a good ability which is critical on timing. Thats why I wanna make this script which will hopefully never fail.
Still not working... i think its a memory leak, something to do with the arrays or for loop. :S
|
|
dev
New Member
Posts: 20
|
Post by dev on Feb 28, 2006 3:58:24 GMT -5
this script will make you complety useless for every HNM LS, also I wouldnt take you with me to diabolos, do you have ever heard of a 'stun order'?
|
|