I hope you can see what is events and what is action.
I havent given you all the actions, but at least the events needed to trigger the trigger
-
Player - Player 1 (Red) types a chat message containing -agi max as An exact match
-
Player - Player 1 (Red) types a chat message containing -agi as An exact match
If you want to buy a specified amount agi tomes, you can do this
6 because thats where the number should start, and 10 because you probably wont order more than a 5 digit number (0-99999)
-
Player - Player 1 (Red) types a chat message containing -agi as A substring
-
Set Amount = (Integer((Substring((Entered chat string), 6, 10))))