Advertisement
OTG

Perform action on arrival

OTG
Dec 19th, 2014
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. Set up a new script, copy and paste everything up to ======
  2.  
  3. function completedSpeedwalk()
  4.  
  5.  
  6. if not arrivalAction then return nil end --if variable not set, exit routine
  7.  
  8. if arrivalAction[1] == "alias" then
  9. expandAlias(arrivalAction[2])
  10. else
  11. send(arrivalAction[2])
  12. end
  13.  
  14. arrivalAction = nil --reset variable so it doesn't constantly fire
  15.  
  16. end
  17.  
  18.  
  19.  
  20. function cancelledSpeedwalk()
  21.  
  22. arrivalAction = nil
  23.  
  24. end
  25.  
  26. registerAnonymousEventHandler("mmapper arrived","completedSpeedwalk")
  27. registerAnonymousEventHandler("mmapper stopped","cancelledSpeedwalk")
  28.  
  29. =====
  30.  
  31. Save the script, make sure it's enabled.
  32.  
  33. When creating your echoLink, it's important to correctly populate the arrivalAction table...
  34.  
  35. echoLink("Mhojave.",[[expandAlias('goto 1234') arrivalAction={'alias', 'rl'} ]],"Click here to walk to Mhojave.",true)
  36.  
  37. arrivalAction[1] should be either "alias" (if the thing to be done is a client side alias) or "send" (if the thing to be done is an in-game command)
  38. arrivalAction[2] should be the alias or the command.
  39.  
  40. eg: send("salute") would be arrivalAction={'send','salute'}
  41. eg: expandAlias("rl") would be arrivalAction={'alias','rl'}
  42.  
  43. Note the use of apostrophes, not quote marks in the table.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement