XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 5 of 5

Thread: Is Walker.IsStuck() a working function?

  1. #1

    Join Date
    Jun 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is Walker.IsStuck() a working function?

    As an example, would this script work?

    Code:
    while (true) do
    
    if Walker.IsStuck() then
       count = count + 1
       
       if (count == 1) then
           Walker.Goto(label1)
    	   elseif (count == 2) then
    	     Walker.Goto(label2)
    		    elseif (count == 3) then
    			  Walker.Goto(label3)
       end
    end	
    	   
    if not Walker.IsStuck() then	   
    count = 0	   
    end
    
    end

  2. #2
    Senior Member Jontor's Avatar
    Join Date
    Sep 2014
    Posts
    446
    Mentioned
    51 Post(s)
    Tagged
    1 Thread(s)
    What are you trying to do?

  3. #3
    Queen Fatality Fatality's Avatar
    Join Date
    Mar 2014
    Location
    Canada
    Posts
    754
    Mentioned
    83 Post(s)
    Tagged
    1 Thread(s)
    Walker.IsStuck() is a working function.

    lua code:

    --- Is walker stuck.
    -- Returns whether the walker is stuck or not
    -- class Walker
    -- return boolean true or false
    Walker.IsStuck = getWalkerStuck


    And I agree with Jontor, What are you doing?

  4. #4

    Join Date
    Jun 2014
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My North American characters have been getting kicked recently without reconnect always working, the clients seem to hang. If I run my scripts while they're in a spawn, walker stuck gets activated. So I've been bringing characters back near the starting point (reason below) but that takes too long. I'm trying to find a work around.

    Thanks Fatality, I looked at that but wasn't sure since it didn't have the '()' beside it. Wanted confirmation before I did any implementations.

    Is there anything wrong with the logic of the above script? I'll run it as a module instead of while (true).

    Edit:
    The reason I bring my characters back to starting point and not change the position manually is because I created a system that auto launches clients, logs in credentials and loads settings while I'm at work or sleep.
    Last edited by KKam II; 03-03-2016 at 06:52 PM.

  5. #5
    Moderator shadowart's Avatar
    Join Date
    Dec 2014
    Location
    Sweden
    Posts
    1,985
    Mentioned
    225 Post(s)
    Tagged
    3 Thread(s)
    Your initial plan may run into some problems when you get stuck due to monsters or players or teleports and stuff like that.

    If you just want your script to start from the right label it will run smoother if you create a table with all possible starting labels and their location, and go to the closest one on the right floor when you start the script (or when you reach a starting abel).

    If you don't care about some inefficiencies you could just use your first script with some minor edits though:
    • Add a wait after the if-statement, maybe 2-5s or so.
    • Make sure the count variable is initialized to 0 in the beginning of the script.
    • Change "count = count + 1" to "count = (count + 1) % X" where X is 1 + the total number of labels you have. Also move it till after the if-statement (you don't want to change label on the first stuck).
    • If you want to ceal up the code you can also stuff your labels into a table and index into it using the count variable.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •