gaz
New Member
Posts: 27
|
Post by gaz on Feb 28, 2006 4:37:04 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'? Opinions are opinions, obviously not a programmer. I'm using this for partys and diablos CoP not prime; I use my smn for big events. If you hate scripts that much, my smn scripts would make your stomache turn as they play a key roll in soloing bcnm's (as it allows command queing faster than any HCI - Thank you tiny ). Anyway, stop flaming please... I asked for help not opinions, you dont have to use it if you dont like ^^ Can i have some help with the code please, I think its not exiting the loop, or maybe its something to do with how i read the array. Here's the code again: 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 think i will try make this a toggle script too, so it can be turned on or off through a regular macro.
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Feb 28, 2006 6:31:26 GMT -5
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 The current version of Lunar is really unstable with the chat code. Tiny should have a fix for this in the next version coming out in a few weeks. As for the code. Target..(" Readies " or " Starts Casting ")..Ability[a].."." This would only evaluate the or condition to true since it's a boolean operator and both strings evaluate to true conditions. This code would work better. 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
|
Warning:- The ability list is used for a parameter in a string.find() function. This provides flexibility, but be cautious when adding to the list. Several characters are considered wildcards by the function. Unless you know what the wildcards are, only use letters, numbers, and spaces in the names of the abilities. If you must use any other character, be sure to precede it with a "%".
Fixes: - Chat codes have been added to keep from being falsely triggered by players casting (if targeted) or by repeating a statement through any chat channel or echos.
- Only 1 statement checking for both WS and Spells on mob only chat codes. Also adds more flexibility with defining abilities.
- Cooldown timer has been added to prevent repeated triggering during the spell cooldown.
- The script will stop search on the subject line if a match has already been found. This prevents multiple triggers if more than one ability listed matches the search.
- The script will not trigger if no target is selected. This prevents triggering if any nearby mob performs any of the listed abilities while no target is selected.
- Changed command target from "<bt>" to "<t>". Prevents miscast due to incorrect target if multiple mobs are being fought by the party.
Known Bugs: - The code can still be falsely triggered if a nearby mob of the same name as the targeted mob performs one of the triggering actions. Currently, there is no way to fix this. This may apply to BST pets as well.
- Theoretical (untested) This script may be affected by chat filter settings. If this bug does exist, there is no way to fix it.
- Theoretical (untested) This script most likely won't work against other players in ballista or brener. The chat codes between mobs and players are different. Removing the code responsible for this would open up another mess of bugs causing fake triggering. This can be looked upon as a prevention against cheating as well.
Ability List Changes: - Added a couple other common abilities Stun is needed for.
- Removed "Goblin Rush". The ability would already have gone off by the time the server receives the command to cast stun.
- Removed excessive WS/Spells. "Cure" covers all cure spells and "aga"/"oga" covers all AoE elemental spells. "ga" would've included all "Poisonga" spells too.
- Added all AM magic.
|
|
gaz
New Member
Posts: 27
|
Post by gaz on Feb 28, 2006 6:56:15 GMT -5
You my friend, are a legend! ^^ Thank you very much, I cant wait to try it out. Trying to think of a work around for the multi mob problem... Chat filters; you always see if a mob readies a spell or ability even with all chat filters on i think. chatCode; Does this need to be defined?EDIT: I cant think of a fix for picking up readies of multi mobs of the same name. Although, with this being such a rare occourance it is not that bad... I can make the script a toggle on or off too. Thanks ^^
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Feb 28, 2006 18:54:44 GMT -5
You my friend, are a legend! ^^ Thank you very much, I cant wait to try it out. np ^.^ Trying to think of a work around for the multi mob problem... The server doesn't send any distinguishing chatacteristics about the mob through chat other than just name. The only way to fix this it to check the data scream coming directly from the server instead of going through what the client says the server sent. There isn't a way to do this as of now. Chat filters; you always see if a mob readies a spell or ability even with all chat filters on i think. Seeing the mob perform an action is different from the text actually poping up in chat. Each chat entry has a code for what type it is. This code is compaired to the filter settings to tell if it should be placed in the log or ignored. The questionable part is whether Lunar picks up the chat data before or after the filters are applied. chatCode; Does this need to be defined? chatCode is defined in line 17. Lua is the only language I know that has this weird functionality of assigning multiple varibles in a single statement. What happens is a call to chatPop() returns 2 values at all times. The first is assigned to chatCode and the second is assigned to chatLine. Here's an example of how this works in code. varA,varB=1,2 varA is assigned the number 1 and varB is assigned the number 2. EDIT: I cant think of a fix for picking up readies of multi mobs of the same name. Although, with this being such a rare occourance it is not that bad... I can make the script a toggle on or off too. This happens alot in tightly crowded areas like Kazham, where many people are partying within a small area. Although after you get to the lvl so you can use Stun, you don't really find yourself in areas like that very often. np ^.^ <Edit: Maybe I should start using spellcheck to catch my typos >
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Feb 28, 2006 19:29:48 GMT -5
I almost forgot to say, all of the FFXI memory functions except chat are broken until Tiny gets the new version of Lunar up an a few weeks. So this script is pretty much bust since FFXI.target_GetName() is out until then.
|
|
gaz
New Member
Posts: 27
|
Post by gaz on Mar 1, 2006 3:35:09 GMT -5
Thanks for the reply. I think i have seen some declerations being called like this before, but the syntax does look a little strange, hehe.
Yeah I know the libs are broke, cant wait to try this out though... Got Drk to 37 now; Darkness Named (Diablos) Sunday ^^ (libs wont be working for that but oh well, i'll probably do it over and over to help others)
I think this script will work well for selective battles, i've posted the latest version on first post.
Thanks again sdphantom ^^
|
|
gaz
New Member
Posts: 27
|
Post by gaz on Mar 16, 2006 7:02:30 GMT -5
Tried the script without the target bit so it just checks the chat log and it error'd.... big time.
POL.exe run time errors X.X
Any ideas?
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Mar 16, 2006 13:18:21 GMT -5
In the current version of Lunar, the chat functions are a bit unstable. Hopefully this would be fixed in the upcoming version.
Also.. Which lines specifically are being commented out?
|
|
gaz
New Member
Posts: 27
|
Post by gaz on Mar 17, 2006 8:42:37 GMT -5
Tried this:
Windower.console_Write('Auto Stun Activated') Ability = { "Sleepga II", "Sleepga", "Bomb Toss", "Nightmare", "Goblin Rush"}
while true do Chat={} LineNumber={} PatternCheck={}
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],((" 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 Mar 17, 2006 14:55:34 GMT -5
That looks like the old code that I fixed by my rewrite.
I also mentioned that Lua has trouble evaluating the expression (" Readies " or " Starts Casting "). This would cause the Lua interpreter to return with a runtime error (still crashes), but it wouldn't be fatal as to crash windower.
Also, when the script does its chatline checks, it'll run into a problem if the script is running as you login. Theoretically, it'll check a negitive chatline number, which would cause a fatal crash, bringing down windower and everything.
Target is a huge deal in trying to isolate the triggers to the mob you're fighting rather than every mob within sight.
Another thing to add, without the cooldown and target codes, the script will trigger everything that matches within your view and SE will undoubtedly notice that.
You also need the chat code checks, else anyone, can falsely trigger the script just by saying any of the ability names in any chatmode or if any mage casts a spell that also relates to a match.
|
|
Onitaru
Junior Member
They call me Pope.
Posts: 62
|
Post by Onitaru on Mar 18, 2006 9:25:44 GMT -5
would help in BCNM fights well I think so I mean if your only looking for one attack like sprouts 40cap AM death is not cool.
|
|
gaz
New Member
Posts: 27
|
Post by gaz on Mar 20, 2006 6:49:41 GMT -5
I was trying to set it up without needing broken libary updates for some BCNM's and Diablos CoP. I think it would be better to wait for the Libarys so the check is more defined. I beleive it is the lack of a cooldown timer which is causing the problem, It will run for a few seconds without anything in chat, but as soon as you start fighting and the chat box is spammed it crashes and FF is shut down. Best option, wait for update i guess
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Mar 20, 2006 16:03:06 GMT -5
Then it's the cause of the buggy chat code. I don't know exactly how the reading and writing of memory at the machine level works, so I can't really give a diagnosis about it, but I have a hunch, that's where the problem is.
At any rate, Tiny says the new version should be more stable with the chat code since there aren't as many threads working it.
|
|
nebula
Junior Member
fear.
Posts: 59
|
Post by nebula on Apr 4, 2006 6:10:13 GMT -5
its a good idea, i would go about it differently, tho Instead of having the script stun for you, just have it pop up an icon when certain spells are being cast, you usually miss it in the log and are not always looking at/close enough to the mob to see the casting effects that would make it useful in all situations you could make it auto-stun with another var that you could toggle
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Apr 7, 2006 19:13:47 GMT -5
I don't use it anyway for a few reasons.
1) The current chat code is buggy as hell and crashes randomly. (Being worked on) 2) Anyone that knows what to watch, what to counter or not, could Stun just as well themselves. 3) I use Stun alot to control mob movement. (Keep the mob from chasing the mages when the tank loses hate)
|
|