Quote System
 

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

Quote System

Started by DeathScythe, 02 August, 2005, 20:49:27

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DeathScythe

QuoteBotName="[Chaotic1]"



memoriesline=5



TimeSpanInMinutes = 1

function Main()

frmHub:RegBot(BotName)

SetTimer(TimeSpanInMinutes*60000)

StartTimer()

SendToAll(BotName,"Chaotic1 V 1.0 STaRTeD")

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.bOperator)  then

  if (command=="!addmemories") then

text=GetOneParam(message)

if (text~=nil) then

local file=openfile("memories.txt","a")

write(file,text.."\n")

closefile(file)

SendToAll(BotName,"Aggiunta nuova memories... Chi sar? il fortunato???")

         curUser:SendPM(BotName,"Memories aggionato..")

return 1

else

curUser:SendPM(BotName,"Hai cannato qualcosa la sintassi corretta : !addmemories frase")

end

 end

      end



end

end



function OnTimer()

countline=1

numberline=random(1,memoriesline)

readfrom("memories.txt")

while 1 do

line = read()

if line == nil then

break

end

if countline==numberline then

SendToAll(BotName,line)

break

end

countline=countline+1

end

readfrom()

end

this was a "memories" script i found sumwhere in the forum its currently lua4..
jus wonder if anyone can adapt it for my needs in lua5..
im looking for a script for ops and + to add quotes.. to record quotes, what people have said that are amusing at that situation.. (reminds me abit like freshstuff)
so just wondering if someone can make it.. with the follow commands
right clicks and commands
addQuote = add a quote to the database
delQuote = delete a quote from the database
allQuotes = show all quotes in PM from database
rQuote = random quote from database

and quotes are show like this
:: [ID : # ] -- [ Quote: <[ev911^DeathScythe]> blah blah blah a lil test ]

# = number
i can probably guess most of the right click commands jus crap on the whole making thing lol

Cheers Peeps!

DeathScythe

Dessamator

its already been done, search the forum
Ignorance is Bliss.

DeathScythe

dess ive tried a search!!!
i cant find it so post me link lol :D

Dessamator

search for "memories by nightlitch"
Ignorance is Bliss.

SMF spam blocked by CleanTalk