PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: WickeD on 20 September, 2004, 08:30:23

Title: Texter!
Post by: WickeD on 20 September, 2004, 08:30:23
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
Title:
Post by: BottledHate on 20 September, 2004, 09:37:11
check out plops texter series.....

http://www.plop.nl/ptokaxbots/Plop.php (http://www.plop.nl/ptokaxbots/Plop.php)

-BH
Title: Hmm!
Post by: WickeD on 20 September, 2004, 10:35:06
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
Title:
Post by: bolamix on 20 September, 2004, 15:54:33
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 :)
Title: Yes!
Post by: WickeD on 20 September, 2004, 20:05:06
Thx my m8!

//WickeD