PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: SmoKinG on 15 February, 2004, 17:49:50

Title: Change redirect addy script
Post by: SmoKinG on 15 February, 2004, 17:49:50
i need a script to change redirect addy by an op if possible...anyone have any ideas?
Title:
Post by: nErBoS on 16 February, 2004, 00:25:46
Hi,

Hope it helps...

--Requested by SmoKinG
--Made by nErBoS

Bot = "Red-Bot"

function Main()
fmrHub:RegBot(Bot)
end

function DataArrival(user, data)
if (strsub(data,1,1)=="<") or (strsub(data,1,5+strlen(Bot))=="$To: "..Bot) then
data=strsub(data,1,strlen(data)-1)
s,e,cmd = strfind(data,"%b<>%s+(%S+)")
if (cmd=="!chred") then
ChangeRedAdd()
return 1
end
end
end

function ChangeRedAdd(user, data)
if (user.bOperator) then
_,_,arg = strfind( data, "%b<>%s+%S+%s+(%S+)" )
frmHub:SetRedirectAddress(arg)
else
user:SendPM(Bot, "You don't have permission to use this command.")
end
end

Best regards, nErBoS
Title:
Post by: NightLitch on 16 February, 2004, 00:30:41
to avoid a simple nil:

function ChangeRedAdd(user, data)
 if (user.bOperator) then
   _,_,arg = strfind( data, "%b<>%s+%S+%s+(%S+)" )
   if arg==nil then
      user:SendData(Bot,"Syntax: !chred
")
      return 1
   end
   frmHub:SetRedirectAddress(arg)
 else
    user:SendPM(Bot, "You don't have permission to use this command.")
 end
end

/NL
Title: =)
Post by: Snoris on 20 February, 2004, 22:25:20
function ChangeRedAdd(user, data)
 if user.iProfile== 0 then
   _,_,arg = strfind( data, "%b<>%s+%S+%s+(%S+)" )
   if arg==nil then
      user:SendData(Bot,"Syntax: !chred
")
      return 1
   end
   frmHub:SetRedirectAddress(arg)
 else
    user:SendPM(Bot, "You don't have permission to use this command.")
 end
end

Not such a great idea to let every OP have the chance to change the Redirect =))
This is only allowing the Master..*nOOb change* =)
Title: thankz
Post by: SmoKinG on 17 March, 2004, 01:45:53
thanks guys ill give it a try