Need difr. scripts
 

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

Need difr. scripts

Started by Smulf, 11 January, 2004, 17:41:56

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Smulf

Hi

I was wondering if someone got these scripts and would like to post them.

1. A simpel script when a user is writing !rules the rules would be shown in main window, it would be nice if I could write the rules in a text file.

2. A script so users can reg them self.

3. A script with an OP bot so only OP's and masters can talk.

4. A script so ONLY masters can talk to each other.

Well anyway thanks if some of them is posible.
 
 
[Smulf]

WickeD

I think that you can get all that funktions out off RoboCop 5b....!

Try it and see...it is the best Bot/Script there is!...But that is me!  =)

Good luck!


//WickeD

Smulf

Thanks but I need them separately...
[Smulf]

NightLitch

Simple Scripts:

Rule-Bot

-- By: NightLitch
Bot = "RuleBot"
filename = "rules.txt"
command = "+rules"

function Main()
	frmHub:RegBot(Bot)
end

function DataArrival(user, data) 
	if( strsub(data, 1, 1) == "<" ) then 
		s,e,cmd = strfind( data, "%b<>%s+(%S+)%s*") 
		cmd=strsub(cmd,1,strlen(cmd)-1) 
		if (cmd==command) then 
			readfrom(textfile) 
			while 1 do 
				line = read() 
				if line == nil then break end 
				user:SendPM(Bot,line) 
			end 
			readfrom() 
		end 
	end 
end

Reg-Me Bot

Bot = "RegMe"

function Main()
end

function DataArrival(user, data) 
	if (strsub(data, 1, 1) == "<") then
		data=strsub(data,1,strlen(data)-1)
		local _,_,cmd=strfind(data, "%b<>%s+(%S+)") 

		if not cmd then return 0; end

		cmd = strlower(cmd)

		if (cmd =="!regme") and not user.bOperator then
			local _,_,cmd,AddPass = strfind( data, "%b<>%s+(%S+)%s+(.+)" )

			if (AddPass ~= nil and strfind(AddPass, "%W") == nil) then
				AddRegUser(user.sName, AddPass,3) 
				user:SendData(Bot," "..user.sName.."  *** You have been succesfull added as new Registred user!! ***")
				user:SendData(Bot, "Your password is:  "..AddPass.."  Reconnect and use that!!")
			else
				user:SendData(Bot,"*** Syntax: !regme  ***");
			end

			return 1;
		elseif (cmd =="!showregs") then
			local ru = GetUsersByProfile(GetProfileName(3))
			for i, n in ru do
				SendPmToNick(user.sName, Bot, n)
			end
		end
	end
end

Master Chat
-- Master-Chat
-- Original VipChat v1.0 
-- By Guibs 10/11/2003
-- Enjoy :)
-- Simple Modify by NightLitch
-- to Master Bot Only

------------------
-- Main Function --
------------------
function Main()
	OPCHAT = "-=Master-Chat=-"
	frmHub:RegBot(OPCHAT)
end

------------------
-- Data Arrival --
------------------

function DataArrival(user,data)
	if(strsub(data,1,4) == "$To:") then
		s,e,whoTo = strfind(data,"$To:%s+(%S+)")
		if whoTo == OPCHAT then
			if user.iProfile == 0 then
				s,e,whoTo,from,msg = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.+)")
				MasterChatRoom(user,msg)
			end
		end
	end
end

function MasterChatRoom(user,msg)
	local allprofiles = GetProfiles()
	local index, profile, index2, nick
	for index, profile in allprofiles do
		local users = GetUsersByProfile(profile)
		for index2, nick in users do
			local usr = GetItemByName(nick)
			if usr ~= nil then
				if user.sName == usr.sName then
				else
					if usr.iProfile == 0 then
						usr:SendData("$To: "..usr.sName.." From: "..OPCHAT.." $<"..user.sName.."> " ..msg)
					end
				end
			end
		end
	end
end

Op/Master Chat

-- Op/Master-Chat
-- Original VipChat v1.0 
-- By Guibs 10/11/2003
-- Enjoy :)
-- Simple Modify by NightLitch
-- to Master Bot Only

------------------
-- Main Function --
------------------
function Main()
	OPCHAT = "-=Op-Chat=-"
	frmHub:RegBot(OPCHAT)
end

------------------
-- Data Arrival --
------------------

function DataArrival(user,data)
	if(strsub(data,1,4) == "$To:") then
		s,e,whoTo = strfind(data,"$To:%s+(%S+)")
		if whoTo == OPCHAT then
			if user.iProfile == 0 or user.iProfile == 1 then
				s,e,whoTo,from,msg = strfind(data,"$To:%s+(%S+)%s+From:%s+(%S+)%s+$%b<>%s+(.+)")
				ChatRoom(user,msg)
			end
		end
	end
end

function ChatRoom(user,msg)
	local allprofiles = GetProfiles()
	local index, profile, index2, nick
	for index, profile in allprofiles do
		local users = GetUsersByProfile(profile)
		for index2, nick in users do
			local usr = GetItemByName(nick)
			if usr ~= nil then
				if user.sName == usr.sName then
				else
					if usr.iProfile == 0 or usr.iProfile == 1 then
						usr:SendData("$To: "..usr.sName.." From: "..OPCHAT.." $<"..user.sName.."> " ..msg)
					end
				end
			end
		end
	end
end

Hope it help's...
//NL

Smulf

Oh thanks alot! Just what I needed...!
[Smulf]

Smulf

Where should I put the rules.txt...?
[Smulf]

B@B?

QuoteOriginally posted by Smulf
Where should I put the rules.txt...?

In the *Scripts* - Folder... :O
THE DAY AFTER...  

...is >>>>>>>> NOW!




Btw:
Plz excuse my english...
It?s not the best, i?m sure...but it?s funny...isn?t it?

raz

y do u need a script if ptokax already has Opchat in it.lolll. :D

B@B?

#8
QuoteOriginally posted by raz
y do u need a script if ptokax already has Opchat in it.lolll. :D

That?s, why below his name stands NEWBIE!

And NEWBIES...we?d all been...since a time, doesn?t we?  :rolleyes:
THE DAY AFTER...  

...is >>>>>>>> NOW!




Btw:
Plz excuse my english...
It?s not the best, i?m sure...but it?s funny...isn?t it?

Smulf

Yeh okay I have found out... I'm only newb with scripting...
[Smulf]

XPMAN

Hey thanks for the stand alone chat scripts....very handy to have. Much appreciated, am using the  Op\Master chat now in the hub.

Thnx again.

NightLitch

#11
Well it wasn't really hard modify Guibs VIP-Chat...

If you all want I can make it so You can Deside yourself
witch levels are allowed chatting in it...?

But Guibs should have the big eloge here for creating it...
//NL

NightLitch

One Point...

The OP/Master Bot is exact the same as the Built-In OP-Chat...

The Master Chat is only for Masters...
//NL

kepp

QuoteOriginally posted by B@B?
QuoteOriginally posted by raz
y do u need a script if ptokax already has Opchat in it.lolll. :D

That?s, why below his name stands NEWBIE!

And NEWBIES...we?d all been...since a time, doesn?t we?  :rolleyes:

So what? NEWBIE or NOT... So are you.. me and everyone else on this forum i suppose, Bacuase no-1 knows everything in LUA, I prefer a stand alone script for OpChat as you can configure it for your needs
Guarding    

NightLitch

agree to your words kepp... We are not here to slap each others face's
for being NEWBIE's... where here to help each others...

or AM I wrong ?
//NL

plop

QuoteOriginally posted by NightLitch
agree to your words kepp... We are not here to slap each others face's
for being NEWBIE's... where here to help each others...

or AM I wrong ?
your right, but i hope you vote left. lol
and just like kepp i have my own opchat in a.i. bot.
reason is simple, didn't like the opchat from ptokax.
my version users can msg straigth into it but can't read it unless the ops use a special command 2 reply.
+ i added a filter for that anoying "Don't ask..." from bcdc++, and away msg's.

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 <----<<

SMF spam blocked by CleanTalk