Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1.  
  2.  
  3. This is my trigger
  4.  
  5. <trigger
  6. enabled="y"
  7. match="[Exits: * ]"
  8. keep_evaluating="y"
  9. send_to="12"
  10. sequence="100"
  11. >
  12. <send>local subTable = { S = "south", W = "west", E = "east", U = "up", D = "down", SW = "sw", NW = "nw", NE = "ne", SE = "se", N = "north" }
  13. local result = "%1"
  14.  
  15. for word in string.gmatch(result, "%w+") do
  16. if subTable[word] then
  17. result = result:gsub(word, subTable[word])
  18. end
  19. end
  20. Simulate("\\n[Exits2: " .. result .. " ]\\n")</send>
  21. </trigger>
  22.  
  23.  
  24. and these are the readouts...
  25.  
  26.  
  27. [Exits: S W SE ]
  28. [Exits2: south west southE ]
  29.  
  30. [Exits: E SE ]
  31. [Exits2: east Seast ]
  32.  
  33.  
  34. They're reading out oddly (Seast instead of se, and southE instead of se, and it seems to depend on if there are also other strings in the exits line as well)
  35. Any idea on how to prevent this? Maybe by using quotes on both?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement