PLZ help me with this one
 

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

PLZ help me with this one

Started by Nafigs, 04 November, 2003, 14:52:43

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nafigs

Whell, i was trying to make a script, there is no syntax error, but he just not working:( can you please tell where is a problem in this one???







BotName="CauruleBot"

commandlinkhelp="!linkhelp"

function Showlinkhelp(target)
target:SendData(BotName,"*** This one is a link bot ***")
target:SendData(BotName,"")
target:SendData(BotName,"!crack: Crack links")
target:SendData(BotName,"!movie: Movie links")
target:SendData(BotName,"")
end

if ("cmd=!crack") then
readfrom("cracklinks.txt")
end

if ("cmd=!movie") then
readfrom("movielinks.txt")
end





pHaTTy

\first of all you need a data arrival, go check in the HOW-TO's i have lessons on writing a bot, go check ;)
Resistance is futile!

pHaTTy

here is how it wud be ;)

BotName="CauruleBot" 

commandlinkhelp="!linkhelp" 

function Showlinkhelp(user)
	user:SendData(BotName,"*** This one is a link bot ***") 
	user:SendData(BotName,"") 
	user:SendData(BotName,"!crack: Crack links") 
	user:SendData(BotName,"!movie: Movie links") 
	user:SendData(BotName,"") 
end 


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

		if (cmd == "!crack") then 
			readfrom("cracklinks.txt") 

		elseif (cmd == "!movie") then 
			readfrom("movielinks.txt") 

		elseif (cmd == commandlinkhelp) then 
			Showlinkhelp(user) 
		end
	end
end

l8rr,,

-phatty
Resistance is futile!

pHaTTy

im not actually sure that
user:SendData BotName,"")
will work, it becomes nil i think maybe a space

user:SendData(BotName," ")
Resistance is futile!

Nafigs

WOW:)))

Thanks gonna check out whrite now!!!
Sorry about my english:)

Nafigs

Whell only the !linkhelp command is working, but he don't what to read from movielinks.txt and cracklinks.txt files:(

I made them and placed in the scripts directory, but.......:(

pHaTTy

heheh it is reading the file just not sending it hehehe

BotName="CauruleBot" 

commandlinkhelp="!linkhelp" 

function Showlinkhelp(user)
	user:SendData(BotName,"*** This one is a link bot ***") 
	user:SendData(BotName,"") 
	user:SendData(BotName,"!crack: Crack links") 
	user:SendData(BotName,"!movie: Movie links") 
	user:SendData(BotName,"") 
end 


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

		if (cmd == "!crack") then 
			readfrom("cracklinks.txt") 
			WhileRead(user)

		elseif (cmd == "!movie") then 
			readfrom("movielinks.txt")
			WhileRead(user) 

		elseif (cmd == commandlinkhelp) then 
			Showlinkhelp(user) 
		end
	end
end



function WhileRead(user)
	while 1 do 
		line = read() 
		if line == nil then break end 
		user:SendData(BotName,line) 
		end 
	readfrom() 
end

l8rr,,

-phatty
Resistance is futile!

Nafigs

I don't know how to thank you:)))

Working perfect:)

Maybe putt this one in the threads? Actually this is a nice idea, because ussualy every body in the hubs asking for new movies or game cracks, and this one can be updeited with searial maybe or music, MP3:)))


http://caurule.netfirms.com

pHaTTy

There is a script that does all of that already ;)
Resistance is futile!

Nafigs

Whell ok ok:)))

Just didn't know about that .

SMF spam blocked by CleanTalk