Everyone who has never used our Bots before, can test each one for 2 days without any limitation.
The trial is given automatically when you login on the Bot, but in some cases it wouldn't work (security reasons).
If this happens, send me a private message and i will be checking the failed trials manually and adding it for those who didn't get it.
We are looking for resellers who may accept payment methods different from ours, including classictibia's cash, realesta's cash, mastercores' cash, etc. Interested? Click here at anytime.



Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Move to X if player X on screen
#1
Hi!

I would like to request a pretty odd/special kind of script


Is it possible to make a script that does the following:

When character X1, X2, X3 (up to 10 characters) enters screen, move north like 5 sqm, and when X1, X2, X3 is off screen, move south like 10 sqm.


To clarify my purpose
Im using block chars, and need them to move when a specific character enters the screen, and move back when this specific character leave screen
Reply

#2
Hello.

I see your point, but moving north 5 sqms and later, to south for 10 sqms, your character will not be back to the first place.

reachlocation() does not works when the location is out of screen, so you may need to setup multiple locations to walk after each other. As you asked to move 10 sqms to south, it will be out of your screen, so you probably need to setup two locations on script below. Add a location that's 5 sqms to south and another that's 5 sqms to south from the one you just added.

I could edit this script to use Cavebot to walk to specific locations based on wpt label.

local BLACK_LIST = { 'player 1', 'enemy guy', 'enemy maker' } -- Players to trigger.
local NORTH_LOCATION = { X = 12345, Y = 12345, Z = 5 }
local SOUTH_LOCATION = {
    { X = 12345, Y = 12345, Z = 5 },
    { X = 12345, Y = 12345, Z = 5 },
} -- reachlocation does not works when the location is out of screen, so you may need to setup multiple locations to walk after each other.

if paround(0, table.unpack(BLACK_LIST)) > 0 then
    reachlocation(NORTH_LOCATION.X, NORTH_LOCATION.Y, NORTH_LOCATION.Z, true)
else
    local final_south = SOUTH_LOCATION[#SOUTH_LOCATION]
    if posx() ~= final_south.X or posy() ~= final_south.Y then
        for _, loc in ipairs(SOUTH_LOCATION) do
            reachlocation(loc.X, loc.Y, loc.Z, true)
        end
    end
end
Reply

#3
I've got a pot blocking the spot to the South
the character will walk like 5 sqm maximum to the north before it hits a wall,
and later walk 5 back before being blocked by the pot, just wanted 10 to be sure it walks all the way to the pot

Edit:
Im blocking the passage for me and a friend, and since he isnt able to move them, i want the blockchars to move to the north when his characters appear on screen, and walk back once he leaves
Reply

#4
Hello.

I see, so the script above works just fine. You have to setup 3 variables:
1. BLACK_LIST -> It's a list of players that triggers the script, which makes the script to moves to NORTH_LOCATION.
2. NORTH_LOCATION -> It's the location where you wanna reach when the players on "BLACK_LIST" show up.
3. SOUTH_LOCATION -> It's the location to go back when no players on screen.

However, as you said that you just need to walk about 5 sqms:

local BLACK_LIST = { 'player 1', 'enemy guy', 'enemy maker' } -- Players to trigger.
local PLAYERFOUND_LOCATION = { X = 12345, Y = 12345, Z = 5 } -- Location to go when players above appears on screen.
local NOPLAYERS_LOCATION = { X = 12345, Y = 12345, Z = 5 }  -- Location to go when cannot found players above.

if paround(0, table.unpack(BLACK_LIST)) > 0 then
    reachlocation(PLAYERFOUND_LOCATION.X, PLAYERFOUND_LOCATION.Y, PLAYERFOUND_LOCATION.Z, true)
else
    if posx() ~= NOPLAYERS_LOCATION.X or posy() ~= NOPLAYERS_LOCATION.Y then
        reachlocation(NOPLAYERS_LOCATION.X, NOPLAYERS_LOCATION.Y, NOPLAYERS_LOCATION.Z, true)
    end
end
Reply

#5
Boooom, works like a charm!
Thank you!
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016