XenoBot Forums - Powered by vBulletin

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Get message error

  1. #1

    Join Date
    Jun 2015
    Posts
    72
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Get message error

    I need get the message: You Can not throw there.
    And I'm not getting by proxy, after some research find that this error comes from the client, but is to capture that error by xenobot?

  2. #2
    Lifetime Subscriber
    Join Date
    Aug 2012
    Location
    Stockholm, Sweden
    Posts
    428
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Can you make more detailed post?

    What script were you using, is it OX scripts? Is it public scripts? Scripts fault? Post script here then...
    Belden's Free Scripts
    Belden's Quest Scripts

    Bought Lifetime Subscription from Fractal
    Bought TeamSpeak 3 Service from Sikkness
    Bought Leveling Service from Y2Quakepc2

  3. #3

    Join Date
    Jun 2015
    Posts
    72
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by krille09 View Post
    Can you make more detailed post?

    What script were you using, is it OX scripts? Is it public scripts? Scripts fault? Post script here then...
    My script. What I want is when the message can not fish more in this place, it deletes the location of the table. That is, so give the error message returned by the customer, he makes this callback. The problem is that I know nothing find this message.

  4. #4
    Moderator shadowart's Avatar
    Join Date
    Dec 2014
    Location
    Sweden
    Posts
    1,985
    Mentioned
    225 Post(s)
    Tagged
    3 Thread(s)
    lua code:

    ErrorMessageProxy.OnReceive("My Proxys Name", function(proxy, message)
    if message == "You cannot throw there." then
    -- Do something
    end
    end)

  5. #5

    Join Date
    Jun 2015
    Posts
    72
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shadowart View Post
    lua code:

    ErrorMessageProxy.OnReceive("My Proxys Name", function(proxy, message)
    if message == "You cannot throw there." then
    -- Do something
    end
    end)
    I tried this earlier, but as I said this response is given by the client and not by the server package. This topic (
    http://forums.xenobot.net/showthread...orMessageProxy) they talk about it, but I did not find any other alternative to correct this problem :/.

  6. #6

    Join Date
    Jun 2015
    Posts
    72
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shadowart View Post
    lua code:

    ErrorMessageProxy.OnReceive("My Proxys Name", function(proxy, message)
    if message == "You cannot throw there." then
    -- Do something
    end
    end)
    http://forums.xenobot.net/showthread...orMessageProxy

    I tried this earlier, but as I said this response is given by the client and not by the server package. This topic they talk about it, but I did not find any other alternative to correct this problem: x.

  7. #7
    Moderator shadowart's Avatar
    Join Date
    Dec 2014
    Location
    Sweden
    Posts
    1,985
    Mentioned
    225 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by brindeds View Post
    http://forums.xenobot.net/showthread...orMessageProxy

    I tried this earlier, but as I said this response is given by the client and not by the server package. This topic they talk about it, but I did not find any other alternative to correct this problem: x.
    "You cannot throw there." messages can be caught by an ErrorMessageProxy. That's what you get from fishing in a bad spot. If you tried it earlier you did it wrong, and/or is playing an OT with different behaviour. I've got it working on real Tibia.

  8. #8

    Join Date
    Jun 2015
    Posts
    72
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shadowart View Post
    "You cannot throw there." messages can be caught by an ErrorMessageProxy. That's what you get from fishing in a bad spot. If you tried it earlier you did it wrong, and/or is playing an OT with different behaviour. I've got it working on real Tibia.
    I tested here and realized the callback only occurs when I manually. The problem that the fishing of module is active when this error happens, and when the module is active it does not activate the callback at all. It would be a bug or something I unaware?

  9. #9
    Moderator shadowart's Avatar
    Join Date
    Dec 2014
    Location
    Sweden
    Posts
    1,985
    Mentioned
    225 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by brindeds View Post
    I tested here and realized the callback only occurs when I manually. The problem that the fishing of module is active when this error happens, and when the module is active it does not activate the callback at all. It would be a bug or something I unaware?
    Sounds like you might have to redesign your fishing module to get it to work. I'd have the fishing module only attempt to fish one square each try, and also store that square in a variable. Then if the proxy detects the error message it blacklists the last attempted square. In pseudo-code:

    lua code:

    -- The implementations for getFishableSquare, isBlacklisted and blacklist are missing.
    -- You'll have to implement them yourself.

    local pos
    Module("Fisher", function(self)
    pos = getFishableSquare()
    if not isBlacklisted(pos) then
    Self.UseItemWithGround("Fishing Rod", pos.x, pos.y, pos.z)
    self:Delay(1000)
    end
    end)

    ErrorMessageProxy.OnReceive("My Proxys Name", function(proxy, message)
    if message == "You cannot throw there." then
    blacklist(pos)
    end
    end)



    The module and the proxy cannot execute at the exact same time, but the proxy can execute during the way between module calls.
    Last edited by shadowart; 12-28-2015 at 06:55 PM.

  10. #10

    Join Date
    Jun 2015
    Posts
    72
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shadowart View Post
    Sounds like you might have to redesign your fishing module to get it to work. I'd have the fishing module only attempt to fish one square each try, and also store that square in a variable. Then if the proxy detects the error message it blacklists the last attempted square. In pseudo-code:

    lua code:

    -- The implementations for getFishableSquare, isBlacklisted and blacklist are missing.
    -- You'll have to implement them yourself.

    local pos
    Module("Fisher", function(self)
    pos = getFishableSquare()
    if not isBlacklisted(pos) then
    Self.UseItemWithGround("Fishing Rod", pos.x, pos.y, pos.z)
    self:Delay(1000)
    end
    end)

    ErrorMessageProxy.OnReceive("My Proxys Name", function(proxy, message)
    if message == "You cannot throw there." then
    blacklist(pos)
    end
    end)



    The module and the proxy cannot execute at the exact same time, but the proxy can execute during the way between module calls.
    getFishableSquare() it is a function that returns a table? Why not have several places where you can fish? :x. From what I realized is no loop to cross it.

    lua code:

    -----Initial Function getFishableSquare
    function getFishableSquare()
    local waterFish = {4597, 4598, 4599, 4600, 4601, 4602}
    local pos = Self.Position()
    local fishTiles = {}
    for x = -7, 7, 1 do
    for y = -5, 5, 1 do
    local tileId = Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id
    if (table.contains(waterFish, tileId)) then
    tilePos = {x = pos.x + x, y = pos.y + y, z = pos.z, error = false}
    table.insert(fishTiles, tilePos)
    end
    end
    end
    return fishTiles
    end
    -----End Function getFishableSquare


    -- The implementations for getFishableSquare, isBlacklisted and blacklist are missing.
    -- You'll have to implement them yourself.

    local pos
    Module("Fisher", function(self)
    pos = getFishableSquare()
    if not isBlacklisted(pos) then
    -- Self.UseItemWithGround("Fishing Rod", pos.x, pos.y, pos.z)
    -- self:Delay(1000)
    print("teste")
    end
    end)

    -----Initial Function blackList
    local blackList = {}
    function blackList(pos)
    table.insert(blackList, pos)
    end
    -----End Function blackList

    -----Initial Function isBlacklisted
    function isBlacklisted(pos)
    for key,value in blackList do
    if(table.contains(pos, blackList[key])) then
    return true
    else
    return false
    end
    end
    end
    -----End Function isBlacklisted

    ErrorMessageProxy.OnReceive("My Proxys Name", function(proxy, message)
    if message == "You cannot throw there." then
    blackList(pos)
    end
    end)

    I do not know what else to try. I am completely exhausted kk.
    Last edited by brindeds; 12-28-2015 at 10:02 PM.

Posting Permissions

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