Advertisement
ppgab

Untitled

Aug 1st, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. -- Lua Tutorial
  2. -- Brought to you by Alpha Scripts
  3.  
  4. -- 2.1
  5. --  Labels
  6.  
  7. -- This will make the connection between Injected Tibia and the Script :
  8.  
  9.     function onWalkerSelectLabel(label)     -- Creating the Label Function (Xeno will check it everytime the walker hits a label)
  10.         if label == "Label Test" then       -- First label
  11.             print('It works! this calls for celebration')
  12.             -- Let's dance
  13.             for i = 0, 10 do
  14.                 Self.Turn(math.random(0,3))
  15.                 wait(400,700)
  16.             end
  17.         elseif label == 'Test2' then        -- Another label
  18.             print('Checking Supplies')
  19.             if Self.ItemCount('health potion') < 5 then
  20.                 Walker.Goto('Leave Hunt')
  21.             end
  22.         end                                 -- Ending the nested ifs       
  23.     end                                     -- Ending the Label Function
  24.  
  25. -- Hooking the Label Function to an Event Listener(in this case, the walker) :
  26.     registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement