+goodpoint?
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

+goodpoint?

Started by D-J Valhala, 10 January, 2004, 11:12:09

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

D-J Valhala

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
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

anubis_say

Good idea :) Please help us

DJ Bert

It's a good idea. Troubadour and i gonna try to make a script for it  :P

D-J Valhala

hehehehe i know :P
hope you can make one

CyA all
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

tezlo

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

DJ Bert

That's a good start ;)

D-J Valhala

#6
thanks m8 but you forgot the BoT name + SendToAll

and "+ungive" GooD point

:D

CyA all
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

tezlo

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

D-J Valhala

yes i know i modefide the scrip and not it work perfect but i nedd +ungive commend

CyA all
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

XPMAN

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

tezlo

points get saved/loaded on script (re)start ;)

D-J Valhala

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
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

Stravides

Quoteand please can you add +ungive good point


This is not neccessary as you can give -1 point
ie ungive 1 point
:)

Regs
Stravides
For RPG Books, Mp3 & Videos
We host trivia  and the ever failing Smeagolbot

D-J Valhala

yes CooL -1 work but whan i reset scrips it wont save the point's

CyA all
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

D-J Valhala

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
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

NotRabidWombat

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


I like childish behavior. Maybe this post will be deleted next.

XPMAN

Appreciate the update. Well done.

DJ Bert

I just tested the script that i updated. That was the same funtion that NotRabidWombat writing. It works fine.  :)

plop

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
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

D-J Valhala

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
My PsyIsrael Network
==================
--=[PsyIsrael DC Hub]=--
--=[PsyIsrael Website]=--
==================

BlazeXxX

Nice one ;) Something i always wanted to have :D

NotRabidWombat

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


I like childish behavior. Maybe this post will be deleted next.

SMF spam blocked by CleanTalk