Log in

View Full Version : Alarm when server msg



basser
11-28-2015, 05:33 PM
Hello, i need alarm script when server msg me that:

** ANTI AFK CHECK **
Please type !afkcheck and answer the question.

Thank you very much

Fatality
11-29-2015, 02:36 AM
Hello, i need alarm script when server msg me that:

** ANTI AFK CHECK **
Please type !afkcheck and answer the question.

Thank you very much

If you can give me a screenshot of what EXACTLY pops up, i can probably help you out. And what client version.

basser
11-29-2015, 05:27 PM
13003

http://postimg.org/image/fsfro6o1v/

just need and alarm to answer the question if im afk :3

Thank you.

anoyn
11-29-2015, 06:42 PM
13003

http://postimg.org/image/fsfro6o1v/

just need and alarm to answer the question if im afk :3

Thank you.

Someone had the same question before the scripts were cleared.

Im fairly sure that GenericTextProxy is currently broken. It will print seemingly random characters instead of the actual messages you are receiving. If someone could verify its status that would be appreciated.

This is the working code i gave the last guy.

Instead of alerting X times, i made this version alert until the "end" key is pressed.


strToFind = "ANTI AFK REMINDER"

hotkeyName = "end"
hotkeyID = 35

--If you want to change the hotkeys:
--Home = 36, PGUP = 33, PGDOWN = 34, END = 35, DELETE = 46

function messageProxyCallback(proxy, message)
if( string.find( message, strToFind) ) then
alerting = true
end
end
-- ErrorMessageProxy.OnReceive("ErrorMessageProxy", messageProxyCallback)
-- BattleMessageProxy.OnReceive("BattleMessageProxy", messageProxyCallback)
-- LootMessageProxy.OnReceive("LootMessageProxy", messageProxyCallback)
-- LookMessageProxy.OnReceive("LookMessageProxy", messageProxyCallback)
GenericTextMessageProxy.OnReceive("GenericTextMessageProxy", messageProxyCallback)

if not Hotkeys.Register(hotkeyID) then
print("Failed to register anti-afk disable hotkey")
end

function pressHandler(key, control, shift)
if alerting then
alerting = false
print("Alarm disabled.")
end
end

Hotkeys.AddPressHandler(pressHandler)

Module.New('checkAlerting', function(checkAlerting)
if alerting then
alert()
print("Fill out the anti-afk check! Press " .. hotkeyName .. " to disable alarm.")
end
checkAlerting:Delay(4000)
end)

basser
11-30-2015, 04:20 PM
Thank you dude ! work so good.

shadowart
11-30-2015, 04:29 PM
Im fairly sure that GenericTextProxy is currently broken. It will print seemingly random characters instead of the actual messages you are receiving. If someone could verify its status that would be appreciated.

I've also received random characters from the generic text message proxy. It was on an OT though, so I'm not sure if it happens on real tibia or even consistently. I haven't used generic proxies for any real script yet.

miguel12979
07-16-2016, 10:59 PM
Hi, this script is not working for me it send me an error:
17:58 XenoScript Error:
Script: AlertAnswer.lua
Line #: 18
Chunk: ...:?Users?migue?DOCUME?1?XenoBot?Scripts??ALERTA? 1.LUA
Error: attempt to index global 'GenericTextMessageProxy' (a nil value)
This is an error with user-input and should not be reported as a bug with XenoBot.

Can you help me make it work?