Post by gaz on Feb 17, 2006 4:51:23 GMT -5
Hi guys, jus started writing a few scripts to make my life easier and am getting really into it.
Theres just 2 snippets i'm having problem with:
1) This is meant to check the distance from the target, then if it is too far away set to follow as long as i'm not moving.
Description: What happens is, the distance check will pass in at any distance unless i put it to 400 then it wont at any distance (so if im right next to the target with it set to 300 it will still follow). I want the follow to kick in if the distance is > 100 and if i have not moved in the past 5 seconds (movement check works i believe).
Next...
2) This is just a syntax problem im sure... I want to be able to pass variables into the send string function. I asume some sort of concatenation would work but i am unfamiliar with perl.
Also tried this
Description: This sends a message to let my target know that i am ready. mytarget is a global defined when the program first runs by getting the current target and setting it to mytarget. However, it appears you can only send a single line string.
Any help would be appreciated, thank you.
Theres just 2 snippets i'm having problem with:
1) This is meant to check the distance from the target, then if it is too far away set to follow as long as i'm not moving.
if distance > 100 and target~="" and target~=myself and status~=33 then --If target is not close
originalx=FFXI.player_GetXPos( ) --Get Original X Y Z Position
originaly=FFXI.player_GetYPos( )
originalz=FFXI.player_GetZPos( )
Windower.script_Sleep(5000) -- Wait 5 seconds
elapsedx=FFXI.player_GetXPos( ) --Get Elapsed X Y Z Position
elapsedy=FFXI.player_GetYPos( )
elapsedz=FFXI.player_GetZPos( ) --A slight diffe in the 2 position sets indicates in the 5 secs the target has moved
Windower.script_Sleep(500)
if originalx==elapsedx and originaly==elapsedy and originalz==elapsedz then--If I've not moved in the 5 secs
Control.control_SendString('/follow')
Windower.script_Sleep(2000)
end
end
Description: What happens is, the distance check will pass in at any distance unless i put it to 400 then it wont at any distance (so if im right next to the target with it set to 300 it will still follow). I want the follow to kick in if the distance is > 100 and if i have not moved in the past 5 seconds (movement check works i believe).
Next...
2) This is just a syntax problem im sure... I want to be able to pass variables into the send string function. I asume some sort of concatenation would work but i am unfamiliar with perl.
if currentmp==maxmp and status==33 then --If MP is full and im healing then stop healing
Control.control_SendString('/tell 'mytarget' Ready: MP:<mp>')
Control.control_SendString('/heal off')
Windower.script_Sleep(6000)
end
Also tried this
if currentmp==maxmp and status==33 then --If MP is full and im healing then stop healing
Control.control_SendString('/tell ', mytarget, ' Ready: MP:<mp>')
Control.control_SendString('/heal off')
Windower.script_Sleep(6000)
end
Description: This sends a message to let my target know that i am ready. mytarget is a global defined when the program first runs by getting the current target and setting it to mytarget. However, it appears you can only send a single line string.
Any help would be appreciated, thank you.