Is There any way too kick non regged users after a set amount of time??
Any help would be great thx :)
:P
I have a script like this at home, i will try to remember to post it when i get in. :))
Thx madman ;c) appreciate it :)
Thx Mutor :)
Not tested it yet but looks like just the script we are looking for :)
Will test it and let u know how we go on....
Thx again for your time and effort :c)
Really appreciate it :)
????????? :P
getting an error :(
stack traceback:
1: function `OnTimer' at line 27
any help would be appreciated.....
thx ?????????
Syntax Error: attempt to index local `kicked' (a nil value)
Syntax Error: attempt to index local `kicked' (a nil value)
Syntax Error: attempt to index local `kicked' (a nil value)
Syntax Error: attempt to index local `kicked' (a nil value)
nope still the same problem :(
I'm Running 0.3.3.0 15.25 debug
Thx for ya help :) and your efforts
?????????
Is it possible to redirect instead of kick?
Heres the one i pulled out of another bot i wrote.
theres 1 command .. ?notreg
this will cause the bot to pm you a list of ppl in hub not regged.
Also added a warning after half their time has elapsed.
restarting the scripts will cause the timers to go blank tho, so ppl already in the hub will stay :(
-- reg to stay bot --
var = {["bot"] = "Reg_to_stay", ["time"] = 10, ["ban"] = 10, ["command"] = "?notreg"}
times = {}
function Main()
frmHub:RegBot(var.bot)
SetTimer(60000*(tonumber(var.time)/4))
StartTimer()
end
function NewUserConnected(Curuser)
if Curuser.iProfile == -1 then
times[Curuser.sName] = var.time
Curuser:SendData (var.bot, "You have to register to stay in this hub, you currently have: "..var.time.." mins to register!")
end
end
function UserDisconnected (Curuser)
times[Curuser.sName] = Nil
end
function OnTimer()
for key, value in times do
value = value - (var.time/4)
times[key] = value
if value == 0 then tokick = GetItemByName(key)
times[tokick] = nil
tokick:SendData (var.bot, "You did not register, so are now temp banned for: "..var.ban.." mins!")
tokick:TimeBan(var.ban)
elseif value == (var.time - tonumber(var.time)/2) then towarn = GetItemByName(key)
towarn:SendData (var.bot, "You have not registered, you will be kicked in: "..value.." mins unless you register!")
end
end
end
function DataArrival(Curuser,data)
data = strsub(data, 1, strlen(data)-1)
if strsub(data, 1, 1) == "<" then
s,e,cmd = strfind(data, "%b<>%s+(%S+)")
if cmd == var.command and Curuser.bOperator then
Curuser:SendPM (var.bot, "The following users are currently not regged:")
for key, value in times do
Curuser:SendPM (var.bot, key.." Has approx "..value.." mins till a kick!")
end
return 1; end
end
end
Im still very new to this, so plz tell me if this is the long way round :P
and it is possible to set it to redirect and not kick, cant remember how at the mo tho :P
PS. not tested until i get home
sorry madman :( no joy with that 1 either............
T.I.A
?????????
ooppsssss,
ammended above post, works fine now :)
QuoteOriginally posted by [UK]Madman
[...]
and it is possible to set it to redirect and not kick, cant remember how at the mo tho :P
maybe this could give a hint ..
user:SendData("$ForceMove "..frmHub:GetRedirectAddress())
good idea for a script ...
how could we have it triggering time indepentent, for each user >?
--- maybe clock() could help ? but i don't know how to use it efficiently atm ...
I think it returns milliseconds ... I am not sure thought .
Nice work mad man :)
Works a treat just gone from 200+ in one off our network hubs to 48 users :)
Like to say ty too all who have replyed and given time in doing so it s apprecitatted big time :)
Many Thx again :)
?????????
Good Idea Herodes, you cud replace the banning command with your $fourcemove :)
tokick:TimeBan(var.ban)
with
tokick:SendData ("$ForceMove "..frmHub:GetRedirectAddress())
Ill have a play with the clock command :)
and yvw ????????? :)
The script is great!!! Thank you :)
Any way to get the bot to notify them every 5 minutes?
Ta :P
EDIT: I have set the ban time to 30minutes and both of the (var.time)/4 to (var.time)/6 so it will notify every 5 minutes, but the unregged still only get 1 PM message after 5 minutes have elapsed... Can anyone help?
Changed:
elseif value == (var.time - tonumber(var.time)/2) then towarn = GetItemByName(key)
To
elseif value == (value) then towarn = GetItemByName(key)
Seems to be ok now :)
What's the lua to make the kick message appear in the hub bot please?
Ta :)
--???????????????????????????????????????????????????????????????????????????????
--? ???????????? HELVETIA REG HUB ???????????? ?
--???????????????????????????????????????????????????????????????????????????????
addy="oberlausitzer.homeip.net" -- ? <<<<< Hier die UmleitungsAdresse angeben ?
-- ??????????????????????????????????????????????
text= "This Hub is for RegUsers only\n"..
" <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n"..
" Here some info to show the Unreg User\n"..
" <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>\n"..
" Here some more info to show\n" -- ? <<<<< Hier denn zusendenen Text angeben ?
--???????????????????????????????????????????????????????????????????????????????
--? ???????????? Oberlausitzer Open Hub ???????????? ?
--???????????????????????????????????????????????????????????????????????????????
function NewUserConnected(user)
if (user.iProfile == -1) then
if (user.sName =="{HubListPinger}") then
else
user:SendData(text.."|$ForceMove "..addy.."|")
end
end
end
function DataArrival(user,data)
if (strsub( data, 1, 8 ) == "$MyINFO ") and (user.iProfile == -1) then
if (user.sName =="{HubListPinger}") then
else
user:SendData(text.."|$ForceMove "..addy.."|")
end
end
end
This is what i do at the moment......to redirect all UnregUsers to my Parttnerhub except the HubListPinger
Not sure what ya mean reefa .. wen a user is kicked, show it in main chat, or opchat ??
We are running RC 8.0b as our security bot and when a user is kicked/regged/timebanned it appears in the security bot window...
So it would be nice to continue to have that so we know who's come and gone, i.e. <-=Hub-Bot=-> user Joe_Bloggs has been banned> for: 0 hours : 30 minutes - Reason: You have failed to register
hope that makes sense!
replace the function ontimer with this 1
function OnTimer()
for key, value in times do
value = value - (var.time/4)
times[key] = value
if value == 0 then tokick = GetItemByName(key)
times[tokick] = nil
tokick:SendData (var.bot, "You did not register, so are now temp banned for: "..var.ban.." mins!")
tokick:TimeBan(var.ban)
SendPmToOps(var.bot, " User "..tokick.." has been banned for: 0 hours : "..var.ban.." minutes - Reason : You have failed to register")
elseif value == (var.time - tonumber(var.time)/2) then towarn = GetItemByName(key)
towarn:SendData (var.bot, "You have not registered, you will be kicked in: "..value.." mins unless you register!")
end
end
end
and change the bot name at the top to the same name as the hub bot...
e.g.
var = {["bot"] = "-=Hub-Bot=-", ["time"] = 10, ["ban"] = 10, ["command"] = "?notreg"}
Ah, so simple, many thanks :)
EDIT: Slight problem...
QuoteSyntax error: attempt to concat global `tokick' (a table value)
stack traceback:
1: function `OnTimer' at line 34 [file `...tware [Robo v8.0b]\scripts\Unreg Timer Kick.lua']
?(
code fixing:
function OnTimer()
for key, value in times do
value = value - (var.time/4)
times[key] = value
if value == 0 then tokick = GetItemByName(key)
times[tokick] = nil
tokick:SendData (var.bot, "You did not register, so are now temp banned for: "..var.ban.." mins!")
tokick:TimeBan(var.ban)
SendPmToOps(var.bot, " User "..tokick.sName.." has been banned for: 0 hours : "..var.ban.." minutes - Reason : You have failed to register")
elseif value == (var.time - tonumber(var.time)/2) then towarn = GetItemByName(key)
towarn:SendData (var.bot, "You have not registered, you will be kicked in: "..value.." mins unless you register!")
end
end
end
var = {["bot"] = "-=Hub-Bot=-", ["time"] = 10, ["ban"] = 10, ["command"] = "?notreg"}
/NL
Perfect, thanks :)