Welcome bot
 

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

Welcome bot

Started by CraKteR, 16 August, 2004, 21:23:27

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CraKteR

Im a Newbie so I have just starting using Lua script so what is wrong in this Script ?

Bot= "-Welcome-"
Prefix1 = "!"		-- Command Prefix

function DataArrival(curUser, data)
	frmHub:RegBot(Bot)
	s,e,msg = strfind(data, "%b<>%s+%S+%s+(.*)")
	if msg == nil or msg=="" then
		curUser:SD(BotName,CmdErrorMsg.." "..Prefix1.."welcome :"..CmdErrorPar)
		return 1
	end
	Welcome[curUser.sName] = msg
	SaveToFile(WelcomeFile , Welcome , "Welcome")
	curUser:SD(BotName,MsgAdd.." \r\n \r\n \t "..msg.." \r\n")
	return 1
end

Snooze

QuoteIm a Newbie so I have just starting using Lua script so what is wrong in this Script ?

Umm.. what exactly did you want this script to do ?


Snooze

CraKteR

#2
It`s a script that a OP/VIP can choose his/her own welcome message..!
like "!welcome Here comes [OP]CraKteR" or so..!

Then it would be like  <-=Pamela=-> Here comes [OP]CraKteR! In main.. when i connect.. and so on to the people that have own welcome messages

Herodes

I would first recomend to see how other ppl have done this ...

there are many many errors in this script that justify that it shouldnt work ...

You will find great help in other ppls scripts and the Scripting.txt in the PtokaX/docs folder ...

Also try watching how the functions, variables, string operations work.

I also recommend learning by heart the tutorials in the HOWTO section of this forum .... especially the
"Build your Own Bot" series from Phatty and the plops tutorials about tables (this should come a bit later..:) and strsub along with pattern matching ...

Welcome and I hope your knowledge and wits grow along with ours :)

SMF spam blocked by CleanTalk