whan user is away if he get PM the Dude Who PM him get the away MSG after each MSG can you change it to be 1 time and like that
DJ-Valhala Is Away : Away MSG
and after it wont show the msg if the user talk to him
10x :D
BotName = "-=<[LsD_-_BoT]>=-"
awayArray={}
function DataArrival(user, data)
if( strsub(data, 1, 1) == "<" ) then
-- remove pipe at the end
data=strsub(data,1,strlen(data)-1)
s,e,cmd,arg = strfind( data, "%b<>%s+(%S+)%s+(.*)" )
if (arg==nil) then
s,e,cmd = strfind( data, "%b<>%s+(%S+)%s*" )
end
if (cmd=="+away") then
if (not (arg)) then
arg = "I'm away. I might answer later if you're lucky."
end
SendToAll(BotName,date(""..user.sName.." Is now away because: ")..arg.."")
awayArray[user.sName]=arg
end
if (cmd=="+back") then
if (awayArray[user.sName]==nil) then
else
SendToAll(BotName,date(""..user.sName.." is back again..."))
awayArray[user.sName]=nil
end
end
end
if(strsub(data, 1, 4) == "$To:") then
-- remove end pipe
data=strsub(data,1,strlen(data)-1)
-- is this meant for an away user?
s,e,whoTo = strfind(data,"$To:%s+(%S+)")
if (awayArray[whoTo] == nil) then
--user is not away
else
user:SendPM(whoTo,"Away Message: "..awayArray[whoTo])
end
end
end
hey dude!
um, i wont even read through this cause its all on the margin...its to hard to read!
when posting scripts please put them within the following context, [*code][*/code], or [*php][*/php]
this enables the text to have tab chars which make life so easy when editing and debuging script!
note :: dont add the * char to code and /code
thankz
whan user is away if he get PM the Dude Who PM him get the away MSG after each MSG can you change it to be 1 time and like that
DJ-Valhala Is Away : Away MSG
and after it wont show the msg if the user talk to him
and can you add is user is away he can't so anothere away like +away MSG
You Allready In Away Mode!
and if back and no in away mode
+back
You are not in away mode!
10x alot!!! :)
BotName = "-=<[LsD_-_BoT]>=-"
awayArray={}
function DataArrival(user, data)
if( strsub(data, 1, 1) == "<" ) then
-- remove pipe at the end
data=strsub(data,1,strlen(data)-1)
s,e,cmd,arg = strfind( data, "%b<>%s+(%S+)%s+(.*)" )
if (arg==nil) then
s,e,cmd = strfind( data, "%b<>%s+(%S+)%s*" )
end
if (cmd=="+away") then
if (not (arg)) then
arg = "I'm away. I might answer later if you're lucky."
end
SendToAll(BotName,date(""..user.sName.." Is now away because: ")..arg.."")
awayArray[user.sName]=arg
end
if (cmd=="+back") then
if (awayArray[user.sName]==nil) then
else
SendToAll(BotName,date(""..user.sName.." is back again..."))
awayArray[user.sName]=nil
end
end
end
if(strsub(data, 1, 4) == "$To:") then
-- remove end pipe
data=strsub(data,1,strlen(data)-1)
-- is this meant for an away user?
s,e,whoTo = strfind(data,"$To:%s+(%S+)")
if (awayArray[whoTo] == nil) then
--user is not away
else
user:SendPM(whoTo,"Away Message: "..awayArray[whoTo])
end
end
end
This might work .. sorry for any errors as im at work and cant test it!! lol :P
BotName = "-=<[LsD_-_BoT]>=-"
awaytable={}
function Main()
frmHub:RegBot(BotName)
end
function DataArrival(user, data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data, "%b<>%s+(%S+)")
if cmd == "+away" then
s,e,cmd,amsg = strfind(data, "%b<>%s+(%S+)%s+(.*)")
if amsg == nil or amsg == "" then amsg = "I'm away. I might answer later if you're lucky."
if awaytable[user.sName] ~= nil then
local mess = awaytable[user.sName]
user:SendData (BotName, "You are already set away, with the message :"..mess); return 1
else SendToAll(BotName," "..user.sName.." Is now away because: "..amsg)
awaytable[user.sName]=amsg
return 1;end
else SendToAll(BotName," "..user.sName.." Is now away because: "..amsg)
awaytable[user.sName]=amsg
return 1
end
elseif (cmd=="+back") then
if awaytable[user.sName] == nil then
user:SendData (BotName, "You are not set to away!!")
return 1
else
SendToAll(BotName," "..user.sName.." is back again...")
awaytable[user.sName]=nil
end
return 1
end
end
if(strsub(data, 1, 4) == "$To:") then
data=strsub(data,1,strlen(data)-1)
s,e,whoTo = strfind(data,"$To:%s+(%S+)")
if awaytable[whoTo] == nil then return 1
else
user:SendPM(whoTo,"Away Message: "..awaytable[whoTo])
end
end
end
Quotelast token read: `end' at line 112 in string "
or am i stupid?
Slight ammendment to the above, think i had an extra end in there!!
Tho line 112 is interesting, since there aint 112 lines . lol
Finishing work now, will check wen home
nuvva slight ammendment, coz it didnt work :rolleyes:
how 2 use? :)
whan user is away if he get PM the Dude Who PM him get the away MSG after each MSG can you change it to be 1 time and like that
DJ-Valhala Is Away : Away MSG
and after it wont show the msg if the user talk to him
But what are the cmds? :)
Current commands:
+away
This sets the user away with their chosen away message, if no message is selected, they will be seat away with the default away message .. e.g.. I'm away. I might answer later if you're lucky.
Anyone sending a PM the the user when set away will recieve the away message.
+back
Removes the away message.
Will try and do other change later, when the boss leaves.....