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
check out plops texter series.....
http://www.plop.nl/ptokaxbots/Plop.php (http://www.plop.nl/ptokaxbots/Plop.php)
-BH
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
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 :)
Thx my m8!
//WickeD