Hi,
I got this script that pretty simple:
botname = "Bot"
function Main()
frmHub:RegBot(botname)
end
function DataArrival(user,data)
if strfind(data, "+rules",1,1) then
readfrom("rules.txt")
while 1 do
line = read()
if line == nil then break end
user:SendPM(botname,line)
end
readfrom()
end
end
But I want to make it so when the command it performed by OPs, a files called, say, rules_Y.txt is displayed in a PM and when regs or VIP perform the same command, a file called rules_X.txt is displayed.
thanks in advance,
pieltre
Hi again,
I forgot to mention, ideally I'd like the bot to pick the txt files from a 'text' folder in the script folder...
thanks again,
pieltre
well hers a little example
Kos = "[RuLeR]"
Command = "+rules"
MasRules = "text/masrules.txt"
OpRules = "text/oprules.txt"
VipRules = "text/viprules.txt"
RegRules = "text/regrules.txt"
function Main()
frmHub:RegBot(Kos)
end
function DataArrival(ustring,dstring)
if strsub(dstring, 1, 1) == "<" then
dstring=strsub(dstring,1,strlen(dstring)-1)
local s,e,cmd = strfind(dstring,"%b<>%s+(%S+)")
if cmd == Command then
if ustring.iProfile == 0 then
file = MasRules
WhileRead(ustring,file)
elseif ustring.bOperator then
file = OpRules
WhileRead(ustring,file)
elseif ustring.iProfile == 2 then
file = VipRules
WhileRead(ustring,file)
else
file = RegRules
WhileRead(ustring,file)
end
end
end
end
function WhileRead(ustring,file)
readfrom(file)
while 1 do
line = read()
if line == nil then
break
end
ustring:SendPM(Kos,line)
end
readfrom()
end
gives u a start (depending on ur profiles.dat)
cant remember the idx thingy not used in long time
works fine. thanks.
damn I even i know the answer to that question ^^
I wanted to help, but oh wel i'll let phatty off this time ^^
QuoteOriginally posted by ????L?F????
oh wel i'll let phatty off this time ^^
?? pmsl
lol, just messing man