nick exchange script
 

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

nick exchange script

Started by HaL, 23 February, 2004, 17:35:37

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

HaL

hey @all

i have a idea 4 a script
but i can?t write it alone

the idea is
if user "ted" write in mainchat
hello
it looks like

hello

and now the script takes a random-name  from the
users.dat maybe there is a user called "al"
the script makes it

hello

the script also exchanges the nicks in mainchat

additionally not only the nicks from users.dat
so some nicks from script

so nobody knows what nick comes next

i called it nickparty
i prefer the comands !npon
and !npoff
so i can turn on and off the nickparty

 

names = {
"Eddi",
"Fish",
"Faker",
"Leecher"
}          

thats what i have but i really can?t write it alone for now
because im not good enought in lua

if party > 0 then
         s,e,mes = strfind(data, "%b<> (.*)")
            if mes == nil then
            else



      name=names[random(1, getn(names))]
                  SendToAll(name, mes)
               return 1
               end


 is there one who will write this script?

HaL

nErBoS

#1
Hi,

If i understood you want a script which changes the nick of a user when is talking, eg:

user writes hello it should appear this..

hello

but the script will make this ...

hello

and you want commands to turn on and off this ??
This command it should only be use by Operatores, right ??

Best regards, nErBoS
--## nErBoS Spot ##--

HaL

yes thats it

but the script should not only change the nicks with the nicks of the names table
there is a useres.dat in ptokax in this are all names of all registered users

the script also changes nicks with registered users and nicks from the table

thx 4 your reply nErBoS

nErBoS

Hi,

You are talking about RegisteredUser.dat it think is not a good ideia to work on that file.
--## nErBoS Spot ##--

HaL

ok can you tell me why do you think so?

its no problem for me to add the reg users to the names table , so you can forget the regusers.dat

:-)

HaL

nErBoS

Hi,

The script that i'm think on doing is no need to use the registereduser.dat the script will work to all connected users, execpt ops.

Best regards, nErBoS
--## nErBoS Spot ##--

nErBoS

Hi,

Hope it helps.....

--Requested by HaL
--Made by nErBoS

Bot = "Playing-Bot"

names = {
	"Eddi", 
	"Fish", 
	"Faker", 
	"Leecher" 
}

affect = {
	"nErBoS"
} --Users that will be affected

play = "off" --Every time you restart script or hub the option play will be off


function Main() 
frmHub:RegBot(Bot) 
end 


function DataArrival(user, data)
	if (play == "on") then
		for i=1, getn(affect) do
		if strfind(data, affect[i]) then
		s,e,msg = strfind(data,"%b<>%s+(.*)")
		name=names[random(1, getn(names))] 
		SendToAll(name, msg)
		return 1
		end
		end
	end

	if (strsub(data,1,1)=="<") or (strsub(data,1,5+strlen(Bot))=="$To: "..Bot) then
	data=strsub(data,1,strlen(data)-1)
	s,e,cmd = strfind(data,"%b<>%s+(%S+)")
		if (cmd=="!play") then
			s,e,opt = strfind(data,"%b<>%s+%S+%s+(%S+)")
			if (opt == "on" or opt == "off") then
				play = opt
				user:SendPM(Bot, "The play has been put "..opt) 
				return 1
			else
			user:SendPM(Bot, "Syntax error, !play . ")
			return 1
			end
		end
	end
end

Best regards, nErBoS
--## nErBoS Spot ##--

HaL

thx nerbos the script works

but could you do some little changes?

the script does for now only change nicks that listet in affected nicks better is that every connected users nick would be changed

if the connected users nicks will be changed with nicks from connected users too would be perfect ;-)

turn on and off the script is allowed for every user better will be only for ops.

great job nErBoS

nErBoS

Hi,

Done..

--Requested by HaL
--Made by nErBoS

Bot = "Playing-Bot"

names = {
	"Eddi", 
	"Fish", 
	"Faker", 
	"Leecher" 
}

affect = {
	"nErBoS"
} --Users that will be affected

play = "off" --Every time you restart script or hub the option play will be off


function Main() 
frmHub:RegBot(Bot) 
end 


function DataArrival(user, data)
	if (play == "on") then
		for i=1, getn(affect) do
		if strfind(data, affect[i]) or (not user.bOperator and strfind(data, user.sName)) then
		s,e,msg = strfind(data,"%b<>%s+(.*)")
		name=names[random(1, getn(names))] 
		SendToAll(name, msg)
		return 1
		end
		end
		
	end

	if (strsub(data,1,1)=="<") or (strsub(data,1,5+strlen(Bot))=="$To: "..Bot) then
	data=strsub(data,1,strlen(data)-1)
	s,e,cmd = strfind(data,"%b<>%s+(%S+)")
		if (cmd=="!play") then
			if (user.bOperator) then
			s,e,opt = strfind(data,"%b<>%s+%S+%s+(%S+)")
			if (opt == "on" or opt == "off") then
				play = opt
				user:SendPM(Bot, "The play has been put "..opt) 
				return 1
			else
			user:SendPM(Bot, "Syntax error, !play . ")
			return 1
			end
			else
			user:SendPM(Bot, "You don't have permission to use this command.")
			return 1
			end
		end
	end
end

Best regards, nErBoS
--## nErBoS Spot ##--

HaL

thx nErBoS

that script  was funny

great work :-)

HaL

i have one problem with the script :-)

i can?t stop it *lol

could some one fix it?

thx HaL

HaL

now i see i need a nick that was not affected
that could stop the nickparty :-)

:-)

nErBoS

#12
Hi,

Any op can stop the script, if the op nick isn?t in the affect list of course, if you have all ops in the affected list the only way to stop it is to restart the script :)

Best regards, nErBoS
--## nErBoS Spot ##--

HaL

hi nErBoS

but the only way to restart the script ist to restart the hub
and the !restartscripts + !restart cmd does not work too

HaL

nErBoS

Hi,

The restartscript should do because i put the play = "off" to start off, instead of using a command try to do manualy. But don?t you have a op that isn?t affect with command to shut down ?? It?s hard that way to urn off the command.

Best regards, nErBoS
--## nErBoS Spot ##--

SMF spam blocked by CleanTalk