I Need BAN and KICK commands.
Where can I find it?
Maybe look in the hubsoft first...
!ban & !kick
here you go ;)
--Quick Kick n Ban script by Phatty
--v1.00
Bot = "Conquerer"
KickCMD = "!kick"
BanCMD = "!ban"
function Main()
frmHub:RegBot(Bot)
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd,arg = strfind(data,"%b<>%s+(%S+)")
if cmd == KickCMD then
nick = GetItemByName(arg)
if arg == nil then
user:SendData(Bot,"Please select a user in the list")
return 1
else
SendToAll(Bot,user.sName.." is kicking: "..nick)
nick:Disconnect()
return 1
end
elseif cmd == BanCMD then
nick = GetItemByName(arg)
if arg == nil then
user:SendData(Bot,"Please select a user in the list")
return 1
else
SendToAll(Bot,user.sName.." is banning: "..nick)
nick:Ban()
return 1
end
end
end
end
l8rr,,
almost forgot
--Quick Kick n Ban script by Phatty
--v1.00
Bot = "Conquerer"
KickCMD = "!kick"
BanCMD = "!ban"
function Main()
frmHub:RegBot(Bot)
end
function DataArrival(user,data)
if strsub(data, 1, 1) == "<" then
data=strsub(data,1,strlen(data)-1)
s,e,cmd,arg = strfind(data,"%b<>%s+(%S+)")
if cmd == KickCMD then
nick = GetItemByName(arg)
if arg == nil then
user:SendData(Bot,"Please select a user in the list")
return 1
else
SendToAll(Bot,user.sName.." is kicking: "..nick)
nick:SendData(Bot,"You are being kicked")
nick:Disconnect()
return 1
end
elseif cmd == BanCMD then
nick = GetItemByName(arg)
if arg == nil then
user:SendData(Bot,"Please select a user in the list")
return 1
else
SendToAll(Bot,user.sName.." is banning: "..nick)
nick:SendData(Bot,"You are being banned")
nick:Ban()
return 1
end
end
end
end
bye,,
Does anyone can test if this script are working?
I'm currently experimenting a lot of troubles with script that have this line: nick = GetItemByName(arg) or similar in it. This script are not wotking either :(
If someone wanna test it please use the following conditions:
odc++ 5.21 and ptokax last beta available.
cant ever work.. the regexp is all wrong
here you go
function DataArrival(user, data)
if not user.bOperator then return end
if strsub(data, 1, 1) ~= "<" then return end
local s, e, cmd, args = strfind(data, "^%b<> %!(%a+)%s*(.*)%|$")
if not s then return end
cmd = strlower(cmd)
if cmd == "kick" then
local s, e, who, why = strfind(args, "^(%S+)%s*(.*)$")
if not s then user:SendData(">> syntax: !kick [reason]") return 1 end
local tmp = GetItemByName(who)
if not tmp then user:SendData(">> "..who.." is not online") return 1 end
if why == "" then why = "for no reason" else why = "because "..why end
SendToAll(" "..user.sName.." is kicking "..tmp.sName.." "..why)
tmp:SendData(" You are being kicked by "..user.sName.." "..why)
tmp:Disconnect()
elseif cmd == "ban" then
local s, e, who, why = strfind(args, "^(%S+)%s*(.*)$")
if not s then user:SendData(">> syntax: !ban [reason]") return 1 end
local tmp = GetItemByName(who)
if not tmp then user:SendData(">> "..who.." is not online") return 1 end
if why == "" then why = "for no reason" else why = "because "..why end
SendToAll(" "..user.sName.." is kicking "..tmp.sName.." "..why)
tmp:SendData(" You are being kicked by "..user.sName.." "..why)
tmp:Disconnect()
else return end
return 1
end
You code too fast tezlo 8o
Can you also take a look into the following thread:
http://board.univ-angers.fr/thread.php?threadid=202&boardid=11&styleid=1&sid=89c7ad49ec49418a75d7ebf9820bee9c
Mainly in last 5 or 6 last post, there is some code inside the script who does not want to work at all, beetween all of you i think it can be fixed.