BOTNAME = "Channel Bot"
userSlaps = {
"[USER] does not have the privilege to bitch slap.",
"[USER] can't slap, only OPs can, BIATCH!",
"Only ops can slap",
"Jitters slaps [USER] upside the head, you can't slap silly!",
"[USER] tries to slap [ARG], but misses.",
"[USER] slaps himself/herself."
}
opsSlaps = {
"USER slaps ARG across the face (temporary ban), because: REASON",
"ARG got bitch slapped by USER for: REASON (temporary ban)"
}
function DataArrival(user, data)
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="+slap") then
if (user.iProfile) == 3 then
index = random(1,getn(userSlaps))
message, x = gsub(userSlaps[index], "%b[]", user.sName)
SendToAll(BOTNAME, message)
return 1
end
--s,e,cmd,arg, reason = strfind(data,"%b<>%s+(%S+)%s+(%S+)%s+(%S)")
s,e,cmd,arg,reason = strfind( data, "%b<>%s+(%S+)%s+(%S+)%s+(.+)" )
if(arg==nil) then
user:SendData("Usage Error. +slap ")
return 1
end
targetUser=GetItemByName(arg)
if(targetUser==nil) then
user:SendData(BOTNAME, "User is not in this dimension")
return 1
end
if(targetUser.sName == user.sName) then
SendToAll(""..user.sName.." slaps himself/herself")
return 1
end
index = random(1,getn(opsSlaps))
message, x = gsub(opsSlaps[index], "USER", user.sName)
message, x = gsub(message, "ARG", arg)
message, x = gsub(message, "REASON", reason)
SendToAll(BOTNAME, message)
-- SendToAll(BOTNAME, ""..user.sName.." slaps "..arg.." across the face (temporary ban), because: "..reason.."")
targetUser:TimeBan(120)
return 1
end
end
Can someone make it that a VIP can not slap someone above them? Like, VIP can't slap Op/Master, and Op can't slap Master.
Hi,
Done, and also made some mod in the code, was a little deorganized in my opinion...
--Mod by nErBoS
BOTNAME = "Channel Bot"
userSlaps = {
"[USER] does not have the privilege to bitch slap.",
"[USER] can't slap, only OPs can, BIATCH!",
"Only ops can slap",
"Jitters slaps [USER] upside the head, you can't slap silly!",
"[USER] tries to slap [ARG], but misses.",
"[USER] slaps himself/herself."
}
opsSlaps = {
"USER slaps ARG across the face (temporary ban), because: REASON",
"ARG got bitch slapped by USER for: REASON (temporary ban)"
}
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=="+slap") then
s,e,arg,reason = strfind( data, "%b<>%s+%S+%s+(%S+)%s+(.+)" )
if(arg == nil) then
user:SendData("Usage Error. +slap ")
else
targetUser=GetItemByName(arg)
if(targetUser == nil) then
user:SendData(BOTNAME, "User is not in this dimension")
else
if(targetUser.sName == user.sName) then
SendToAll(""..user.sName.." slaps himself/herself")
elseif(user.iProfile > targetUser.iProfile) then
user:SendData(BOTNAME, "You don?t have Autorathy to slap this user.")
elseif (user.iProfile == 3 or user.iProfile == 2) then
index = random(1,getn(userSlaps))
message, x = gsub(userSlaps[index], "%b[]", user.sName)
SendToAll(BOTNAME, message)
elseif (user.bOperator) then
index = random(1,getn(opsSlaps))
message, x = gsub(opsSlaps[index], "USER", user.sName)
message, x = gsub(message, "ARG", arg)
message, x = gsub(message, "REASON", reason)
SendToAll(BOTNAME, message)
-- SendToAll(BOTNAME, ""..user.sName.." slaps "..arg.." across the face (temporary ban), because: "..reason.."")
targetUser:TimeBan(120)
end
end
end
return 1
end
end
end
Best regards, nErBoS