
Originally Posted by
brindeds
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.