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
Player move to X position on message
#1
Hello can you help me to do a script works like that.:


he have a position, he cannot lose this position but,

when i msg him "UP" he walk one sqm NORTH -- and turn back to last position

when i msg him "DOWN" he walk one sqm SOUTH -- and turn back to last position
Reply

#2
local LOCATION = { X = 12345, Y = 12345, Z = 6 }
local CHARACTER = 'Your character'
local DELAY_AFTERWALKING = { Min = 1000, Max = 3000 }


local messages = getnewmessages()
for _, msg in ipairs(messages) do
    if msg.sender:lower() == CHARACTER:lower() then
        if msg.content == 'UP' then
            move('n')
            if DELAY_AFTERWALKING.Max > 0 then
                wait(DELAY_AFTERWALKING.Min, DELAY_AFTERWALKING.Max)
            end
        elseif msg.content == 'RIGHT' then
            move('e')
            if DELAY_AFTERWALKING.Max > 0 then
                wait(DELAY_AFTERWALKING.Min, DELAY_AFTERWALKING.Max)
            end
        elseif msg.content == 'DOWN' then
            move('s')
            if DELAY_AFTERWALKING.Max > 0 then
                wait(DELAY_AFTERWALKING.Min, DELAY_AFTERWALKING.Max)
            end
        elseif msg.content == 'LEFT' then
            move('w')
            if DELAY_AFTERWALKING.Max > 0 then
                wait(DELAY_AFTERWALKING.Min, DELAY_AFTERWALKING.Max)
            end
        end
    end
end

if posx() ~= LOCATION.X or posy() ~= LOCATION.Y then
    reachlocation(LOCATION.X, LOCATION.Y, LOCATION.Z)
end
Reply

#3
he dont move, no errors on console
Reply

#4
Hello.

I can't test it again atm, but i would bet that:
1. You didn't setup the character name properly. It should be the name of the character that will send the message.
2. You did not select the right channel for the character running the script. If you are going to send the message on the default channel then you must have the default channel selected on the character that runs the script.
3. You are not sending the correct messages. It works with "UP" (uppercase), not "up" (lowercase).
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016