Bot Reply-er
 

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

Bot Reply-er

Started by TTB, 17 October, 2005, 15:35:18

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TTB

Hi,

Was a request, finished it, and here is it published.

-- Automatic BOT replyer, by PM 
-- Created by TTB, 17-10-05 
-- Request from Leun 
-------------------------------------------- 
 
bots = { 
	["[BOT]CBS"] = 1, 
	["[BOT]Predator"] = 1, 
} 
 
bot = "PMreport" 
 
WhoAreTheOps = { 
[-1] = 1,  -- Users 
[0] = 1,   -- Masters 
[1] = 0,   -- OPs 
[2] = 0,   -- VIPs 
[3] = 0,   -- REGs 
[4] = 1,   -- MODs 
[5] = 1,   -- Founders 
} 
 
function Main() 
	frmHub:RegBot(bot) 
end 
 
function OpSend(msg) 
	for i,v in frmHub:GetOnlineUsers() do 
		if WhoAreTheOps[v.iProfile] == 1 then 
			v:SendPM(bot,msg) 
		end 
	end 
end 
 
function ToArrival(curUser,data) 
	local _,_,whoTo,mes = string.find(data,"$To:%s+(%S+)%s+From:%s+%S+%s+$(.*)") 
	if (bots[whoTo]==1 and string.find(mes,"%b<>%s+(.*)")) then 
		data = string.sub(mes,1,string.len(mes)-1) 
		curUser:SendPM(whoTo, "I'm a BOT! So that means I'm stupid and only configured by someone who is smarter than me. Please PM to PMtoOPs for your questions...") 
		OpSend("The user: "..curUser.sName.."  was trying to talk to me:  "..mes) 
	end 
end
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

TTB

This should be the last script you load in PtokaX!! Otherwise you will have problems by your commands from your other bots!
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

Markitos

QuoteOriginally posted by TTB
This should be the last script you load in PtokaX!! Otherwise you will have problems by your commands from your other bots!

Leun

good work, if tested it, and it works great !!!!!!!!

Thnx,

TTB

QuoteOriginally posted by Markitos
QuoteOriginally posted by TTB
This should be the last script you load in PtokaX!! Otherwise you will have problems by your commands from your other bots!

Because.... The script only just catches if there is a ToArrival to the bot(s). If there is, it will reply. But... let me explain it by example:

You run RoboCop. Type in PM to the bot !help. After this command, robocop will end this with a "return 1" which means, no other script can catch this when it is loaded AFTER robocop.

So, when the script is loaded before RoboCop, this script will catch it first, and after that the command will be catched by Robocop, even when the command exists!

I hope you understand...
TTB

(? ?.??.-> Admin @ Surfnet hubs <-.??.???)

Markitos

QuoteOriginally posted by TTB
QuoteOriginally posted by Markitos
QuoteOriginally posted by TTB
This should be the last script you load in PtokaX!! Otherwise you will have problems by your commands from your other bots!

Because.... The script only just catches if there is a ToArrival to the bot(s). If there is, it will reply. But... let me explain it by example:

You run RoboCop. Type in PM to the bot !help. After this command, robocop will end this with a "return 1" which means, no other script can catch this when it is loaded AFTER robocop.

So, when the script is loaded before RoboCop, this script will catch it first, and after that the command will be catched by Robocop, even when the command exists!

I hope you understand...
Yep thnks!

SMF spam blocked by CleanTalk