PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: DorianG on 23 February, 2004, 16:55:10

Title: Conflit with Robocop
Post by: DorianG on 23 February, 2004, 16:55:10
Why? If i use this my script with Robocop, Robocop doesn't work?


BotName = "REG"

prefix = "!"

command = prefix.."regme"

function Main()
frmHub:RegBot(BotName)
end

function NewUserConnected(user)
if user.iProfile == -1 then
user:SendPM(BotName, "To register your self "..command..",then wait an operator")
end
end

function DataArrival(user, data)
if (strsub(data,1,1) == "<") then
data = strsub(data,1,strlen(data)-1)
local s,e,cmd = nil
s,e,cmd = strfind(data, "%b<>%s(%S+)")
if user.iProfile == -1 then
if cmd == command then
SendPmToOps(BotName, "User "..user.sName.." want to be registered")  
user:SendPM(BotName, "Plese wait an Operator")
end
return 1
else
user:SendPM(BotName, "You are not allowd to use this command")
return 1
end
end
end
Title:
Post by: Optimus on 23 February, 2004, 17:47:51
Hiya i think this is what you been looking for?


BotName = "REG"

prefix = "!"

function Main()
frmHub:RegBot(BotName)
end

function NewUserConnected(user)
if user.iProfile == -1 then
user:SendPM(BotName, "To register your self "..prefix.."regme, then wait an operator")
end
end

function DataArrival(user, data)
if (strsub(data, 1, 1) == "<" ) then
data=strsub(data,1,strlen(data)-1)
_,_,cmd=strfind(data, "%b<>%s+(%S+)")

if (cmd) then
if user.iProfile == -1 then
if (cmd==prefix.."regme") then
SendPmToOps(BotName, "User "..user.sName.." want to be registered")  
user:SendPM(BotName, "Plese wait an Operator")
return 1
else
user:SendPM(BotName, "You are not allowd to use this command")
return 1
end
end
end
end
end



L8trs Opti
Title:
Post by: DorianG on 23 February, 2004, 18:48:37
thank Optimus, the script it's all right now ;)
Title:
Post by: DorianG on 24 February, 2004, 12:43:33
Sorry Optimus, but i have finded a conflit with help command.
If an user use !help command, the command doesn't open the help file..
Title:
Post by: Flux on 24 February, 2004, 13:06:58
I have found that Robocop will not allow multi hub linking to work too from the new DC Hub Link.

Which is a damn shame as my hub as a good reputation with another hub and we wanted to multi link our hubs it only works when Robocop is not installed on the other hub but they love robocop so we are hoping that maybe someone can tell us why this maybe the case with Robocop and if anything can be done...
Title:
Post by: Optimus on 24 February, 2004, 20:33:13
QuoteSorry Optimus, but i have finded a conflit with help command.
If an user use !help command, the command doesn't open the help file..

Users use !userhelp :D

About the hublink thingy mmm, i don't know haven't checked that out. Maybe it has some todo with the HubProtection that it blocks some other data to.
Title:
Post by: DorianG on 25 February, 2004, 12:43:33
i think that the problem is in the command..

if user.iProfile == -1 then

because if an user use !userhelp.. My Bot reply with this message..

user:SendPM(BotName, "You are not allowd to use this command")
Title:
Post by: Optimus on 25 February, 2004, 16:24:02
Ok tested this must work, here you go!

BotName = "REG"

prefix = "!"

function Main()
frmHub:RegBot(BotName)
end

function NewUserConnected(user)
if user.iProfile == -1 then
user:SendPM(BotName, "To register your self "..prefix.."regme, then wait an operator")
end
end

function DataArrival(user, data)
if (strsub(data, 1, 1) == "<" ) then
data=strsub(data,1,strlen(data)-1)
_,_,cmd=strfind(data, "%b<>%s+(%S+)")

if (cmd) then
if (cmd==prefix.."regme") then
if user.iProfile == -1 then
SendPmToOps(BotName, "User "..user.sName.." want to be registered")  
user:SendPM(BotName, "Plese wait an Operator")
return 1
else
user:SendPM(BotName, "You are not allowd to use this command")
return 1
end
end
end
end
end

Title:
Post by: Optimus on 25 February, 2004, 16:26:51
BTW: I added this function to the Next RoboCopv7.0 release...
Title:
Post by: DorianG on 26 February, 2004, 13:12:55
thank Optimus, now works ;) . Really? It's fantastic.