Easy script... very easy
 

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

Easy script... very easy

Started by 6Marilyn6Manson6, 24 December, 2004, 12:22:05

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

6Marilyn6Manson6

Hello I have little problem... I have this script:


--Bot ideato da 6Marilyn6Manson6 per il suo splendido amore ???L&J??? il 24 / 12 / 2004 alle 11.42
--Solo ???L&J??? pu? usare il comando azione
--Ah... dimenticavo: ???L&J??? TI AMO by JO ^__^
BotName="???UnaGocciaNell'Oceano???"
botspeed = "???UnaGocciaNell'Oceano???"

function Main()
	frmHub:RegBot(BotName)
end	

function GetCommand(message)
	s,e,command=strfind(message,"(%S+)")
	return command
end
function GetOneParam(message)
	s,e,param1=strfind(message,"%S+%s(.*)")
	return param1
end
function DataArrival(curUser, data)
	if( strsub(data, 1, 1) == "<" ) then 
		data=strsub(data,1,strlen(data)-1) 
		s,e,message = strfind( data, "%b<>%s+(.*)") 
		command=GetCommand(message)
		if (curUser.iProfile) == 0 and (curUser.sName) == Scripter then
			if (command=="!amore") then
				masstext=GetOneParam(message)
				if (masstext~=nil) then
					curUser:SendPM(BotName,"Un dolce messaggio da ???L&J???:")
					SendPmToAll(BotName,masstext.."  by "..curUser.sName)
					return 1
				else
					curUser:SendPM(BotName,"Amore mio... hai sbagliato comando. La stringa giusta ? : !amore  [ricorda che TI AMO   by JO]")
				end
			end
		end
	end
end


but... If I have this:


--Bot ideato da 6Marilyn6Manson6 per il suo splendido amore ???L&J??? il 24 / 12 / 2004 alle 11.42
--Solo ???L&J??? pu? usare il comando azione
--Ah... dimenticavo: ???L&J??? TI AMO by JO ^__^
BotName="???UnaGocciaNell'Oceano???"
botspeed = "???UnaGocciaNell'Oceano???"

function Main()
	frmHub:RegBot(BotName)
end	

function GetCommand(message)
	s,e,command=strfind(message,"(%S+)")
	return command
end
function GetOneParam(message)
	s,e,param1=strfind(message,"%S+%s(.*)")
	return param1
end
function DataArrival(curUser, data)
	if( strsub(data, 1, 1) == "<" ) then 
		data=strsub(data,1,strlen(data)-1) 
		s,e,message = strfind( data, "%b<>%s+(.*)") 
		command=GetCommand(message)
		if (curUser.iProfile) == 0 and (curUser.sName) == ???L&J??? then
			if (command=="!amore") then
				masstext=GetOneParam(message)
				if (masstext~=nil) then
					curUser:SendPM(BotName,"Un dolce messaggio da ???L&J???:")
					SendPmToAll(BotName,masstext.."  by "..curUser.sName)
					return 1
				else
					curUser:SendPM(BotName,"Amore mio... hai sbagliato comando. La stringa giusta ? : !amore  [ricorda che TI AMO   by JO]")
				end
			end
		end
	end
end

I have error in line 24... why? thanks

[_XStaTiC_]

#1
change this line
if (curUser.iProfile) == 0 and (curUser.sName) == ???L&J??? then

to

if (curUser.iProfile) == 0 and (curUser.sName) == "???L&J???" then



happy X-mas 2@ll

Optimus

Quotes,e,command=strfind(message,"(%S+)")
small improvement you could do is to make all stringfinds local

Example:

local s,e,command=strfind(message,"(%S+)")

local s,e,param1=strfind(message,"%S+%s(.*)")

local s,e,message = strfind( data, "%b<>%s+(.*)")

local command=GetCommand(message)

Cheers;)

6Marilyn6Manson6

Thanks a lot Optimus ;)
Thanks a lot XSTETIC
thanks thanks ;)

6Marilyn6Manson6

Hello, I have request for my script:

--Bot ideato da 6Marilyn6Manson6 per il suo splendido amore ???L&J??? il 24 / 12 / 2004 alle 11.42
--Solo ???L&J??? pu? usare il comando azione
--Ah... dimenticavo: ???L&J??? TI AMO by JO ^__^
BotName="???UnaGocciaNell'Oceano???"
botspeed = "???UnaGocciaNell'Oceano???"

function Main()
	frmHub:RegBot(BotName)
end	

function GetCommand(message)
	local s,e,command=strfind(message,"(%S+)")
	return command
end
function GetOneParam(message)
	local s,e,param1=strfind(message,"%S+%s(.*)")
	return param1
end
function DataArrival(curUser, data)
	if( strsub(data, 1, 1) == "<" ) then 
		data=strsub(data,1,strlen(data)-1) 
		local s,e,message = strfind( data, "%b<>%s+(.*)") 
		local command=GetCommand(message)
		if (curUser.iProfile) == 0 and (curUser.sName) == "???L&J???" then
			if (command=="!amore") then
				local masstext=GetOneParam(message)
				if (masstext~=nil) then
					curUser:SendPM(BotName,"Un dolce messaggio da ???L&J???:")
					SendPmToAll(BotName,masstext.."  by "..curUser.sName)
					return 1
				else
					curUser:SendPM(BotName,"Amore mio... hai sbagliato comando. La stringa giusta ? : !amore  [ricorda che TI AMO   by JO]")
				end
			end
		end
	end
end

I want add information of bot... share, description, email, connection type... Thanks

Optimus

I changed your script above so the variables are local that is better and faster. This way they are removed from memory after they are used.

Sorry had to do that lOOL

6Marilyn6Manson6

I don't understand :P

Optimus

Take a closer look at the script you posted i changed it there. You will see what i changed then

6Marilyn6Manson6

#8
Example I want this:


--Bot ideato da 6Marilyn6Manson6 per il suo splendido amore ???L&J??? il 24 / 12 / 2004 alle 11.42
--Solo ???L&J??? pu? usare il comando azione
--Ah... dimenticavo: ???L&J??? TI AMO by JO ^__^
BotName="???UnaGocciaNell'Oceano???"
botspeed = "???UnaGocciaNell'Oceano???"

function Main()
	frmHub:RegBot(BotName)
	Bot_Share_Size = 0.0 * 1024 *1024
	Bot_email = "6marilyn6manson6@aliceposta.it" 
	Bot_Speed = "DSL" 
	Bot_TAG = "< AmOrE : V:0.1 >"
	Bot_Descr = "< Made by: 6Marilyn6Manson6 >" 
end	

function GetCommand(message)
	s,e,command=strfind(message,"(%S+)")
	return command
end
function GetOneParam(message)
	s,e,param1=strfind(message,"%S+%s(.*)")
	return param1
end
function DataArrival(curUser, data)
	if( strsub(data, 1, 1) == "<" ) then 
		data=strsub(data,1,strlen(data)-1) 
		s,e,message = strfind( data, "%b<>%s+(.*)") 
		command=GetCommand(message)
		if (curUser.iProfile) == 0 and (curUser.sName) == "???L&J???" then
			if (command=="!amore") then
				masstext=GetOneParam(message)
				if (masstext~=nil) then
					curUser:SendPM(BotName,"Un dolce messaggio da ???L&J???:")
					SendPmToAll(BotName,masstext.."  by "..curUser.sName)
					return 1
				else
					curUser:SendPM(BotName,"Amore mio... hai sbagliato comando. La stringa giusta ? : !amore  [ricorda che TI AMO   by JO]")
				end
			end
		end
	end
end


not have syntax error...... but information not found :(

Madman

--Bot ideato da 6Marilyn6Manson6 per il suo splendido amore ???L&J??? il 24 / 12 / 2004 alle 11.42
--Solo ???L&J??? pu? usare il comando azione
--Ah... dimenticavo: ???L&J??? TI AMO by JO ^__^

BotName="???UnaGocciaNell'Oceano???"
BotEmail = "6marilyn6manson6@aliceposta.it"
BotSpeed = "DSL"
BotTag = "< AmOrE : V:0.1 >"
MyInfoString = "$MyINFO $ALL "..BotName.." "..BotTag.."$ $"..BotSpeed..strchar( 1 ).."$"..BotEmail.."$"

function Main()
	frmHub:RegBot(BotName)
	SendToAll(MyInfoString)
end

function GetCommand(message)
	local s,e,command=strfind(message,"(%S+)")
	return command
end

function GetOneParam(message)
	local s,e,param1=strfind(message,"%S+%s(.*)")
	return param1
end

function DataArrival(curUser, data)
	if( strsub(data, 1, 1) == "<" ) then 
		data=strsub(data,1,strlen(data)-1) 
		local s,e,message = strfind( data, "%b<>%s+(.*)") 
		local command=GetCommand(message)
		if (curUser.iProfile) == 0 and (curUser.sName) == "???L&J???" then
			if (command=="!amore") then
				local masstext=GetOneParam(message)
				if (masstext~=nil) then
					curUser:SendPM(BotName,"Un dolce messaggio da ???L&J???:")
					SendPmToAll(BotName,masstext.."  by "..curUser.sName)
					return 1
				else
					curUser:SendPM(BotName,"Amore mio... hai sbagliato comando. La stringa giusta ? : !amore  [ricorda che TI AMO   by JO]")
				end
			end
		end
	end
end

That should work... =)
No need to write  BotShare, it will get 0 anyway...
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

6Marilyn6Manson6

#10
madman thanks a lot ^__^

Optimus

6Marilyn6Manson6 i need to say this.

if you wane learn something you need to listen better to the advice you have been given. I even gave away the hint how todo it.

And what do i see you post the same ugly script with out the locals again. hum hum

Is it so hard to read/listen and following advice you have been given.

You now give me the idea to not help you any more cause it is a wast of time.

Is that what you want?

You can learn so much on this forum but you just don't see it or care.

This is just a advice you don't need to follow it.

Greetingz Optimus

6Marilyn6Manson6

No optimus no no.... I want your help and of all... I'm not have seed your changes, and i'm really sorry for this. I'm sorry for all... It's don't happen again...Sorry

SMF spam blocked by CleanTalk