sup ppl's i need some GooD script for my good user's :)
can a script be write for that i can give a user a GooD point like +warn but not warn the user give hem a good point and the BoT will count the good point's and will post "the best user of the WeeK" "the best user of the month"
and only the OP's can use that commend
coz all the OP's commend are bad for the user i wanna be GooD for the user it will be FuN =)))
and what i give GooD point for user it will SendToAll + SendPM
CyA all
Good idea :) Please help us
It's a good idea. Troubadour and i gonna try to make a script for it :P
hehehehe i know :P
hope you can make one
CyA all
cool idea.. heres a start
points = {}
function Main()
points = dofile("points.dat") or {}
end
function OnExit()
local f = openfile("points.dat", "w+")
assert(f, "points.dat")
write(f, "return {\n")
for nick, value in points do
write(f, "\t"..format("[%q]", nick).." = "..value..",\n")
end; write(f, "}")
closefile(f)
end
function DataArrival(user, data)
if strsub(data, 1, 1) == "<" then
local s, e, cmd, args = strfind(data, "^%b<> %+(%a+)%s*(.*)%|$")
if s then
cmd = strlower(cmd)
if cmd == "give" and user.bOperator then
local s, e, nick, value, reason = strfind(args, "^(%S+)%s*([%d%-]*)%s*(.*)$")
if s then
if value == "" then value = 1
else value = tonumber(value) end
if reason == "" then reason = "for no reason"
else reason = "because "..reason end
points[nick] = (points[nick] or 0) + value
user:SendData(">> "..nick.." now has "..points[nick].." points")
SendToNick(nick, ">> "..user.sName.." has given you "..value.." points "..reason)
else
user:SendData(">> syntax: +give [points] [reason]")
end
elseif cmd == "topusers" then
local index = {}
for nick, value in points do tinsert(index, nick) end
sort(index, function(a, b) return points[a] > points[b] end)
local n = getn(index)
if n > 10 then n = 10 end
user:SendData(">> top "..n.." users..")
for i = 1, n do
local nick = index[i]
local value = points[nick]
user:SendData(">>\t["..value.."]\t "..nick)
end
else return
end; return 1
end
end
end
OPs can +give [points] [reason]
points and reason are optional
by default 1 point and no reason
points can also be negative :)
anyone can +topusers
topweek topmonth would be pain to do
maybe later.. or if someone else can be bothered
That's a good start ;)
thanks m8 but you forgot the BoT name + SendToAll
and "+ungive" GooD point
:D
CyA all
theres no need for a botname
if you really want.. insert this below SendToNick
SendToAll("whoever", nick.." got "..value.." points "..reason)
i think it would get annoying
and well.. you can give negative points
yes i know i modefide the scrip and not it work perfect but i nedd +ungive commend
CyA all
This is a very kool script. Just wondering though, If the hub goes down ,does everything get reset so when the hub restarts everyone is at 0 or does everyone keep what they have even if the hub restarts?
Could find out the easy way...by just resetting the hub, but its been humming along (PtokaX that is) for 42days now.
What would really be kool would be to automate it. For example someone in the hub for (x amount) days gets 25 points (make adjustable)
members of the hub already are eating this point thing up.....kinda like a status thing to them i guess..trying to see who can "earn" the most points.
Anyways, just wondering about if it keeps all the data when the hub is reset.
My thnx again for such a kool script. Never dreamed a script this small could draw so much attention in the hub..lol
points get saved/loaded on script (re)start ;)
it dont save the points whan i restart the scripts it give 0 point to 0 users
:\
and please can you add +ungive good point
CyA all
Quoteand please can you add +ungive good point
This is not neccessary as you can give -1 point
ie ungive 1 point
:)
Regs
yes CooL -1 work but whan i reset scrips it wont save the point's
CyA all
can enyone moddefy the scrip??????????????????
it not work good the script dont save the point's and dont send PM to user who got the good point
maybe plop?
:\
CyA all
quick fix. Now saves the table every time you change points. This will also save data in the event of a crash.
points = {}
function Main()
points = dofile("points.dat") or {}
end
function OnExit()
local f = openfile("points.dat", "w+")
assert(f, "points.dat")
write(f, "return {\n")
for nick, value in points do
write(f, "\t"..format("[%q]", nick).." = "..value..",\n")
end; write(f, "}")
closefile(f)
end
function DataArrival(user, data)
if strsub(data, 1, 1) == "<" then
local s, e, cmd, args = strfind(data, "^%b<> %+(%a+)%s*(.*)%|$")
if s then
cmd = strlower(cmd)
if cmd == "give" and user.bOperator then
local s, e, nick, value, reason = strfind(args, "^(%S+)%s*([%d%-]*)%s*(.*)$")
if s then
if value == "" then value = 1
else value = tonumber(value) end
if reason == "" then reason = "for no reason"
else reason = "because "..reason end
points[nick] = (points[nick] or 0) + value
user:SendData(">> "..nick.." now has "..points[nick].." points")
SendToNick(nick, ">> "..user.sName.." has given you "..value.." points "..reason)
OnExit();
else
user:SendData(">> syntax: +give [points] [reason]")
end
elseif cmd == "topusers" then
local index = {}
for nick, value in points do tinsert(index, nick) end
sort(index, function(a, b) return points[a] > points[b] end)
local n = getn(index)
if n > 10 then n = 10 end
user:SendData(">> top "..n.." users..")
for i = 1, n do
local nick = index[i]
local value = points[nick]
user:SendData(">>\t["..value.."]\t "..nick)
end
else return
end; return 1
end
end
end
Appreciate the update. Well done.
I just tested the script that i updated. That was the same funtion that NotRabidWombat writing. It works fine. :)
it was actualy saving automaticly on closing/restarting of ptokax, but only on 0.3.3.0.
function OnExit() is new in that version.
plop
the sctipt work GooooooooD NotRabidWombat 10x
now can you add to the script 2 new things?
i whant that the script will post 1 in a week "the best user of the week" + " the best user of the month???
:D
CyA all
Nice one ;) Something i always wanted to have :D
Yes... but for some reason PtokaX has an *elite* group of beta testers and we do not have access to that version. So I made it save all the time which is the only thing you can really do with TD4.
-NotRabidWombat