Texter!
 

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

Texter!

Started by WickeD, 20 September, 2004, 08:30:23

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WickeD

I need a script that shows a list of commands in a PM when a user write command: !help-info

Like this:

-----------------------------------------------------
Help-Info Commands for you:

!xxxxxxxxxx
!xxxxxxxxxx
!xxxxxxxxxx
!xxxxxxxxxx
!xxxxxxxxxx
!xxxxxxxxxx
!xxxxxxxxxx
!xxxxxxxxxx
!xxxxxxxxxx
!xxxxxxxxxx

Write the commands in Main-Chat and you get the Help-Info in a PM.
------------------------------------------------------

And each command will open a xxxxxxxxxx.txt file in a PM to the user.


Can eny one help mee whit this?  Or is there a script like this in Lua Forum? I can?t find one!


//WickeD

BottledHate

Homepage: www.bottledhate.webhop.org

Compiling  Lua scripts is LAME!!!!!

WickeD

Plop?s Texter do not work like I want it to work!

Can eny one make the script so it work as I writed at the top off this Request?

Plz!

//WickeD

bolamix

#3
Hiya,
I use the following, I think it does what u want Wicked. The command is +cmd.

--Made by Piglja(Just learning;P )
--Many thanks to aMustex 4 being so patient and with helping 4 some probs within the script:)
--Bits and pieces added by bolamix for Aiwadirock!

botname = "#HubBot" --your bot's name here
function Main()
	frmHub:RegBot(botname)
end
-- here you specify the files with the commands for ops and regular users
OpFile = "helpfiles/ophelp.txt"
UserFile = "helpfiles/userhelp.txt"


function DataArrival(user, data)
	if (strsub(data, 1, 1) == "<") then
		data = strsub(data,1,strlen(data)-1) 
		local s,e,cmd = strfind(data,"%b<>%s+(%S+)")
		if (cmd=="+cmd") then
			if (user.bOperator) then
				Help(user, OpFile)
			else	
				Help(user, UserFile)
			end 
		return 1
		end	
	end
end

function NewUserConnected(user)
	Help(user, charte)
end


function Help(user, UserFile)
   	local filecontents = ""
	local handle = openfile(UserFile, "r")
	if (handle ~= nil) then
		local line = read(handle)
		while line do
        	filecontents = filecontents..line.."\r\n"
		line = read(handle)
		end
		closefile(handle)
      	user:SendPM(botname, filecontents)
	end
end


Over the months I've added lots of things to that kinda basic script (I say "basic" but I wouldn't have been able to create it, thanks to Piglja & aMutex): a mass-message function, an "uptime" function (returns the hub's uptime), a "your ip is..." function... you can add more help files, you can show the rules of your hub... I like it :)
Sharing is of the essence!

Live music >> Aiwadirock! live music hub
PtokaX knowledge >> The PtokaX Wiki

WickeD

Thx my m8!

//WickeD

SMF spam blocked by CleanTalk