hi i have a small prob seeming though the hub gives out no errors at all, but the function still doesnt work :(
elseif (cmd=="!hubrs") then
if user.iProfile == 0 then
SendData(BOTName, " *** HUBNACHRICHT from "..curUser..", The Hub needs to be restarted, this takes but a second so no worry's you can just reconnect. *** ")
return 1
elseif user.iProfile ~== 0 then
user:SendPM(BOTName, "you are not allowed to use this command")
end
elseif (cmd=="!hubserverrs") then
if user.iProfile == 0 then
SendData(BOTName, " *** HUBMESSAGE from "..curUser..", The Hubserver needs to be restarted. This usually takes approx 15 minutes, after that you can all reconnect. Sorry for any inconveniences. Cya L8ter *** ")
return 1
elseif user.iProfile ~== 0 then
user:SendPM(BOTName, "you are not allowed to use this command")
return 1
end
I got it working last night but i did something wrong with it and cant remember what :D
it is supposed to end up here...
Edited and actual Version
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=="!help") then
if user.iProfile == nil then
SendUserhelp(user)
return 1
elseif user.iProfile == 0 then
SendMasterhelp(user)
return 1
elseif user.iProfile == 1 then
SendOpshelp(user)
return 1
elseif user.iProfile == 2 then
SendViphelp(user)
return 1
elseif user.iProfile == 3 then
SendReghelp(user)
return 1
elseif user.iProfile == 4 then
SendModeratorhelp(user)
return 1
end
[COLOR=red] elseif (cmd=="!hubrs") then
if user.iProfile == 0 then
SendData(BOTName, " *** HUBNACHRICHT von "..curUser..", Der Hub wird Kurz mal neugestartet, Dies dauert nur Kurz und dann k?nnt ihr gleich wieder verbinden *** ")
return 1
end
elseif user.iProfile ~= 0 then
user:SendPM(BOTName, "du bist nicht befugt diesen Befehl auszuf?hren")
return 1
elseif (cmd=="!hubserverrs") then
if user.iProfile == 0 then
SendData(BOTName, " *** HUBNACHRICHT von "..curUser..", Der Hubserver wird mal neugestartet....Dies dauert in der Regel ca 15 Minuten. Also bis gleich *** ")
return 1
elseif user.iProfile ~= 0 then
user:SendPM(BOTName, "du bist nicht befugt diesen Befehl auszuf?hren")
return 1
end [/COLOR]
elseif (cmd=="!lol") then
SendLol(user)
return 1
elseif (cmd=="!rules") then
SendRules(user)
return 1
elseif (cmd=="!network") then
SendNetwork(user)
return 1
elseif (cmd=="!faq") then
SendFaq(user)
return 1
elseif (cmd=="!description") then
SendDescription(user)
return 1
elseif (cmd=="!showreg") then
showreg(user)
return 1
elseif (cmd == "!myip" ) then
user:SendData(BOTName,"Deine Ip lautet: "..user.sIP)
return 1
elseif (cmd == "!myversion" ) then
user:SendData(BOTName,"Deine Client Version ist: "..user.iVersion)
return 1
elseif (cmd == "!addreguser") then
if user.iProfile == 1 or user.iProfile == 0 or user.iProfile == 4 then
return 0
elseif user.iProfile == nil then
user:SendPM(BOTName, "du bist nicht befugt diesen Befehl auszuf?hren")
end
elseif (cmd == "!me") then
AddAChatter(sUser)
return 0
end
local s, e, cmd, args = strfind(data, "^%b<> %!(%a+)%s*(.*)%|$")
if s and ptokaxcommands[cmd] then
if user.iProfile == 1 or user.iProfile == 0 or user.iProfile == 4 then
return 0
elseif user.iProfile == nil then
SendPM(BOTName, "du bist nicht befugt diesen Befehl auszuf?hren")
end
local s, e, cmd, args = strfind(data, "^%b<> %!(%a+)%s*(.*)%|$")
if s and ptokax2commands[cmd] then
if user.iProfile == 1 or user.iProfile == 4 then
return 0
elseif user.iProfile == nil then
SendPM(BOTName, "du bist nicht befugt diesen Befehl auszuf?hren")
end
elseif (cmd == "!restartscripts") and user.iProfile == 0 then
return 0
elseif (cmd == "!restart") and user.iProfile == 0 then
return 0
end
end
elseif strsub(data, 1,7) == "$MyINFO" and user.sName ~= "{HubListPinger}" then
if not excludeUsers[user.sName] then
local _,_,openhubs = strfind( data , ".+H:(%d+)" );
if OpenCheck == 1 then
if ( openhubs ~= "0" ) then
SendToNick( user.sName , "Du bist in einen oder mehreren Open Hubs. Dies verst?sst gegen unsere Regeln. Deshalb wird die Verbindung zur?ckgesetzt!" )
user:Disconnect()
end
end
end
end
from what I notice the problem seems to be here ( noted in red) if user.iProfile == 0 then
SendData(BOTName, " *** HUBNACHRICHT from "..curUser..", The Hub needs to be restarted, this takes but a second so no worry's you can just reconnect. *** ")
return 1
elseif user.iProfile [color=red]~==[/color] 0 then
user:SendPM(BOTName, "you are not allowed to use this command")
end
elseif (cmd=="!hubserverrs") then
yeah that and something else in another part of the script lol
that stupid =
:D
thnx herodes
i now have this and it works fine
elseif (cmd=="!hubrs") then
if user.iProfile == 0 then
SendPmToAll(BOTName, "\t\t*** HUBNACHRICHT von "..user.sName.." ***\r\n\r\n\t *** Der Hub wird Kurz mal neugestartet, Dies dauert nur Kurz und dann k?nnt ihr gleich wieder verbinden *** ")
return 1
elseif user.iProfile ~= 0 then
user:SendPM(BOTName, "du bist nicht befugt diesen Befehl auszuf?hren")
return 1
end
elseif (cmd=="!hubserverrs") then
if user.iProfile == 0 then
SendPmToAll(BOTName, "\t\t*** HUBNACHRICHT von "..user.sName.." ***\r\n\r\n\t *** Der Hubserver wird mal neugestartet.... Dies dauert in der Regel etwas um die 15 Minuten. Also bis gleich *** ")
return 1
elseif user.iProfile ~= 0 then
user:SendPM(BOTName, "du bist nicht befugt diesen Befehl auszuf?hren")
return 1
end
btw how would i have to edit these lines to make it possible as Admin to send Mass messages?
As in
("\t\t*** HUBNACHRICHT von "..user.sName.." ***\r\n\r\n\t *** Msg ***)
with Trigger !Mass? I tried once using Chill's from SL0.47 but i couldn't get it to work standalone lol
try instead of
if user.iProfile == 0 then
to use end in these conditions... somthing like...
*considering your admin Profile is 5
if user.iProfile == 0 or user.iProfile == 5 then
QuoteOriginally posted by Herodes
try instead of
if user.iProfile == 0 then
to use end in these conditions... somthing like...
*considering your admin Profile is 5
if user.iProfile == 0 or user.iProfile == 5 then
Not quite what i asked but still some usefull info :)
I'm still looking for an easy way to change the line to write the Message yourself
as in for example
!mass here comes the text you want to send
i've been looking for a simple standalone Mass message bot but havent found one without other stuff with it.
Now I understand you,...
Basically you need to catch the cmd and the msg like this ...
s,e,cmd,msg = strfind(data, "%b<>%s+(%S+)%s+(.*)")
Then use SendPmToAll(from, msg)
Hi,
For futher doubts take a look HERE (http://board.univ-angers.fr/thread.php?threadid=763&boardid=4&sid=d20c4cb5cf9cd4432edc7b96d0d74ca4) to see what magical char can do to help you out.
Best regards, nErBoS
thnx m8
any idea why this doesnt work?
SendPmToAll(BOTName, "\t\t*** HUBNACHRICHT von "..user.sName.." ***\r\n\r\n\t ***" msg)
Hi,
There is missing this...
SendPmToAll(BOTName, "\t\t*** HUBNACHRICHT von "..user.sName.." ***\r\n\r\n\t ***"[b]..msg[/b])
Best regards, nErBoS