problem in changeing in LUA 5
 

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

problem in changeing in LUA 5

Started by LiqUiD~TrolL, 15 March, 2005, 16:33:39

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LiqUiD~TrolL

hello everyone

well my frineds i recently deside to change in robocop 10 and in new ptoka x

so i ve started changeing all my hub scripts in LUA 5

but the point is that i don t know how to cahnge them,anyone can tell me a tip???

--==@plop i need your lights of science =o)@==--

right now i m useing 2 of plops scripts :

--------- FreshStuff v.3.2 --------------

-- Name the commands to what U like

-- This command adds stuff, syntax : +addalbum TYPE/CATAGORY THESTUFF2ADD

cmd1 = "+addrls"



-- This command shows the stuff, syntax : +albums with options new/game/warez/music/movie

cmd2 = "+rlsall"



-- This command deletes an entry, syntax : +delalbum THESTUFF2DELETE

cmd3 = "+delrls"



-- This command shows the latest stuff, syntax : +newalbums

cmd4 = "+rls"



-- This command reloads the txt file. syntax : +reloadalbums

-- (this command is needed if you manualy edit the text file)

cmd5 = "+reloadalbums"



-- Show latest stuff on entry 1=yes, 0=no

ShowOnEntry = 0



-- Max stuff shown on newalbums/entry

MaxNew = 40



-- The file storing the stuff

file = "releases.txt"



-- Name of the bot

Bot = "-NemO-"



-- you can add catagory's yourself ["trigger_name"]="catagory_name"

Types = {["psychedelic"] = "Psychedelic", ["ambient"]="Ambient", ["electronic"]="Electronic", ["psytrance"]="Psytrance", ["goa"]="Goa", ["chill"]="Chill", ["psytrance"]="Psytrance", ["house"]="House", ["proggresive"]="Proggresive", ["trance"]="Trance", ["psymovie"]="Psymovie"}





--------------------- don't change anything below here

AllStuff = {}

NewestStuff = {}



function Main()

 frmHub:RegBot(Bot)

 ReloadRel()

end



function NewUserConnected(user)

 if ShowOnEntry == 1 then

 user:SendPM(Bot, MsgNew.."|")

 end

end



function OpConnected(user)

 if ShowOnEntry == 1 then

 user:SendPM(Bot, MsgNew.."|")

 end

end



function DataArrival(user,data)

 if (strsub(data, 1, 1) == "<") then

  data = strsub(data,1,strlen(data)-1)

  s,e,cmd,type,tune = strfind(data, "%b<>%s+(%S+)%s*(%S*)%s*(.*)")

  if cmd == cmd2 then

   if type == "" then

    user:SendPM(Bot, MsgAll.."|")

    elseif type == "new" then

    user:SendPM(Bot, MsgNew.."|")

   elseif Types[type] then

    ShowRelType(type)

    user:SendPM(Bot, MsgType.."|")

   end

  return 1

  elseif cmd == cmd4 then

 user:SendPM(Bot, MsgNew.."|")

 return 1

 elseif (user.bOperator or user.iProfile == 2) then

 if cmd == cmd3 then

  if type ~= "" then

  DelRel(user, type)

  else

  user:SendData(Bot, "yea right, like i know what i got 2 delete when you don't tell me!|")

  end

 return 1

 elseif cmd == cmd1 then

 if tune ~= "" and Types[type] then

  AddRel(user, tune, type)

  elseif Types[type] == nil then

  user:SendData(Bot, "I need to know the catagory to add it to!|")

  else

  user:SendData(Bot, "yea right, like i know what you got 2 add when you don't tell me!|")

  end

 return 1

 elseif cmd == cmd5 then

  ReloadRel()

  user:SendData(Bot, "Albums reloaded!|")

 return 1

 end

 end

end

end



function OpenRel()

AllStuff = nil

NewestStuff = nil

AllStuff = {}

NewestStuff = {}

Count = 0

Count2 = 0

readfrom(file)

while 1 do

local line = read()

if ( line == nil ) then

break

else

Count = Count +1

AllStuff[Count]=line

end

end

readfrom()

if Count > MaxNew then

local temp = Count - MaxNew + 1

for i=temp, Count do

Count2 = Count2 + 1

NewestStuff[Count2]=AllStuff

end

else

for i=1, Count do

Count2 = Count2 + 1

NewestStuff[Count2]=AllStuff

end

end

end



function ShowRel(table)

Msg = "\r\n"

if table == NewestStuff then

if Count2 == 0 then

MsgNew = "\r\n\r\n".." --------- The Latest Releases -------- \r\n\r\n No releases on the list yet\r\n\r\n --------- The Latest Releases -------- \r\n\r\n"

else

for i=1, Count2 do

s,e,type,who,when,title=strfind(NewestStuff, "(.+)$(.+)$(.+)$(.+)")

if title then

Msg = Msg.." "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n"

else

Msg = Msg..NewestStuff.."\r\n"

end

end

MsgNew = "\r\n\r\n".." --------- The Latest "..MaxNew.." Releases -------- "..Msg.."\r\n --------- The Latest "..MaxNew.." Releases -------- \r\n\r\n"

end

else

if Count == 0 then

MsgAll = "\r\n\r\r\n".." --------- All The Releases -------- \r\n\r\n No releases on the list yet\r\n\r\n --------- All The Releases -------- \r\n\r\n"

else

MsgHelp = " use "..cmd2.."
for a,b in Types do

MsgHelp = MsgHelp.."/"..a

end

MsgHelp = MsgHelp.."> to see only the selected types"

for i=1, Count do

s,e,type,who,when,title=strfind(AllStuff, "(.+)$(.+)$(.+)$(.+)")

if title then

Msg = Msg.." "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n"

else

Msg = Msg..AllStuff.."\r\n"

end

end

MsgAll = "\r\n\r\r\n".." --------- All The Releases -------- "..Msg.."\r\n --------- All The Releases -------- \r\n"..MsgHelp.."\r\n"

end

end

end



function ShowRelType(what)

Msg = "\r\n"

tmp = 0

if Count == 0 then

MsgType = "\r\n\r\n".." --------- All The "..Types[what].." -------- \r\n\r\n No "..strlower(Types[what]).." yet\r\n\r\n --------- All The "..Types[what].." -------- \r\n\r\n"

else

for i=1, Count do

s,e,type,who,when,title=strfind(AllStuff, "(.+)$(.+)$(.+)$(.+)")

if type == what then

tmp = tmp + 1

Msg = Msg.." "..when.." -- "..who.." -- "..title.."\r\n"

end

end

if tmp == 0 then

MsgType = "\r\n\r\n".." --------- All The "..Types[what].." -------- \r\n\r\n No "..strlower(Types[what]).." yet\r\n\r\n --------- All The "..Types[what].." -------- \r\n\r\n"

else

MsgType= "\r\n\r\n".." --------- All The "..Types[what].." -------- \r\n"..Msg.."\r\n --------- All The "..Types[what].." -------- \r\n\r\n"

end

end

end



function AddRel(user, what, type)

Count = Count + 1

AllStuff[Count]=(type.."$"..user.sName.."$"..date("%x").."$"..what)

user:SendData(Bot, what.." is added to the releases as "..type.."|")

SaveRel()

ReloadRel()

end



function DelRel(user, what)

Okie = nil

for a,b in AllStuff do

s,e,title=strfind(b, ".+$(.+)$")

if title == what then

AllStuff[a]=nil

user:SendData(Bot, what.." is removed from the releases|")

Okie = 1

break

end

end

if Okie then

SaveRel()

ReloadRel()

else

user:SendData(Bot, what.." wasn't found in the releases|")

end

end



function SaveRel()

writeto(file)

for i=1,Count do

if AllStuff then

write(AllStuff.."\n")

end

end

writeto()

end



function ReloadRel()

OpenRel()

ShowRel(NewestStuff)

ShowRel(AllStuff)

end





















ANd here is the second one script i wanna change


---------AnTiFlooD By PloP_(4.5.4)---------------------------

but i wanna ask something  , OPtimus with the protection you added ,do i need now an antiflood script?? is it nessecary or it s just lose of memory of the server??? =)


greetings all my mates keep good work in LUa WoRlD_!!
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

jiten

#1
Check these threads for different LUA 5 FreshStuff versions:

Here , Here , Here  and Here.
 

and for the deflood script, u can get it here .

Best regards,

jiten

PS: by the way, try using the Search function before requesting. there are cases when the scripts u want have been already posted  :]

LiqUiD~TrolL

tnx for helping me m8 the releases are grat now everything is ok =)

have a nice day
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

jiten


LiqUiD~TrolL

my friend the script it is working great,all commands working good

exept 1 thing,ahah the important one

when i m trying to delete a release

with : +delrls

this message appears in the main chat in my hub :

[19:29:20] <•NemO•> I need the ID number to delete a releas


what ID number?? lool what the hell is this ???


plopppp can you give a hand here???
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

jiten

Well, u can find the Id of each release, after listing the entries with +rls or +rlsall.
Then, u'll get something like this:

--------- All The Releases -------- 
  ID: 1 -- 03/22/05 -- jiten -- movie -- Blade 3
 --------- All The Releases -------- 
  use +albums  to see only the selected types


As u can see, there's the ID. In this case, it's 1.

Cheers.

LiqUiD~TrolL

there is no ID number when i m pressing +rls or +rlsall


this is the PM tha dissplaied

  03/13/05 -- LiqUiD~TrolL -- psychedelic -- Psytekk_-_Space_Syndrome-2005-MYCEL
  03/13/05 -- LiqUiD~TrolL -- psychedelic -- Nexus_-_Psycho_Therapy-(Remastered)-2005-ASS
  03/14/05 -- chip -- ambient -- VA_-_Chillout_Mix_on_Radio_HRXXL_07-09-2003-zEn
  03/14/05 -- LiqUiD~TrolL -- psychedelic -- Sub6_-_Bozow-(CDS)-2005-iR-CA
  03/14/05 -- LiqUiD~TrolL -- psychedelic -- Space_Safari_-_Early_Reflections-1999-zEn
  03/14/05 -- .Hulligan. -- psychedelic -- D.j_ToM_Harush_-_Time_To_Say_Hello-ECT PsyChedelic
  03/14/05 -- ']['rIp•iN•?uN -- psychedelic -- Bizzare_Contact_-_Ecstasy-2005-cep
  03/14/05 -- LiqUiD~TrolL -- psychedelic -- Wrecked_Machines_and_Domestic_-_This_One-(CDS)-2005-iR-CA
  03/14/05 -- LiqUiD~TrolL -- psychedelic -- Silicon_Isness_-_In_My_Head-(CDS)-2005-iR-CA
  03/14/05 -- AstraL -- psychedelic -- X-Wave_-_Direct-X-2005-MYCEL Psychedelic
  03/15/05 -- LiqUiD~TrolL -- psychedelic -- VA_-_Goa-Visions-Psychedelic_Trance_Vol_2-2CD-2000-zEn
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

jiten

Replace this in ur script:
Msg = Msg.." "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n"


with:
Msg = Msg.."  ID: "..i.." -- "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n"


Then, save the file, restart ur scripts and list the releases with +rls or +rlsall.
I guess that should do it. At least with me it's working well.

Best regards,

jiten

LiqUiD~TrolL

ok here i am again,well it works but now there is other problem


look in my releases list i have about 1000 and maby
more releases,so when i m typing +rls the script show me the latest 40 releases,but with the ID number from : 1 to 40 so when i m trying to delete the relerase with ID number 1-40 it deletes the releases they are in the top of the 1000 releases list =( so it deletes diffrend relese from the one i want really to delete.

=( shit i m despirate ..
maybe the one you told me to replace i add it in worng place?? cause this -->Msg = Msg.."  ID: "..i.." -- "..when.." -- "..who.." -- "..type.." -- "..title.."\r\n

it is 2-3 times wirten in the script can yopu send the full script plz??



sorry i m disturbing all the time
i wish i knew how to fix LUA alone =)
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

bastya_elvtars

#9
You might want to try this.

-- // edit

Link updated.
Everything could have been anything else and it would have just as much meaning.

LiqUiD~TrolL

hello man

well bastya_elvtars the script you told me have the same problem =/

look m8 i want to delete the releases in the end of my 1000 and more releases i have added.not the first 40 ones in the list =(

this is my problem,whne you press +rls it displays the lates 40

how can i delete the latest 40 releases ?? how should i know the ID number of them the are thousands of releases there
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

bastya_elvtars

#11
QuoteChangelog for freshstuff 3.7.5

- added choice between showing in main or PM on entry
- new stuff is shown by real ID (idea by LiqUiD~TrolL)
- security fixes have been made, corrupt entries are ignored

These are the tw end of the sme rod. :P
Everything could have been anything else and it would have just as much meaning.

LiqUiD~TrolL

ok here is something more for plop i ve noticed right now

the search command it works great BUT

if the release is added like :
[23:48] <•NemO•>
---------- You searched for keyword "Psysex". The results: ----------

  02/11/04 -- PrInCe -- Skazi_Vs_Psysex_-_Loylty-CDR-2004-LiM
  08/11/04 -- PrInCe -- Psysex_Feat._Michelle_Adamson_-_Your_Place_or_Mine-2004-AoeL
  01/01/05 -- SaGit -- Psysex_and_Rocky_-_Japanise_Owa-(Unreleased)-2004-AoeL
  02/06/05 -- LiqUiD~TrolL -- Psysex_-_Come_in_Peace_(Illumination_Rmx)-(Unr)-2005-AoeL
  02/12/05 -- LiqUiD~TrolL -- Psysex_-_Alien_Cop_(Eskimo_Rmx)-(CDS)-2005-iR-CA
  02/13/05 -- LiqUiD~TrolL -- Psysex_-_Altered_States_(X-Noize_Rmx)-(Unr)-2005-AoeL



and i search for Psysex it works great

BUT if i search for  " psysex "  with small letter the search  didn t find anything  

there s a good question for you guys =)

who can fix this ? the search string ??
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

LiqUiD~TrolL

------>>>>  These are the tw end of the sme rod.


what you mean???
haha you mixed me up m8 =)

you fixed the script ?? and by the way when i press +rls there is no ID by the release
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

bastya_elvtars

You have to re-download, you are using 3.7, and latest is 3.7.5 which is more secure and your idea is contained.

BTW search is case sensitive atm. Thx for pointing this out, will be fixed in next version. :)
Everything could have been anything else and it would have just as much meaning.

jiten

#15
QuoteOriginally posted by jiten
Great job, bastya! :)
Btw, I was testing the FreshStuff 3.7 script and found a small "bug".
When I add a release with more than one line like this:

[08:19:42]  jiten added to the movie releases: oooooooooooooooooooooooooooooo
ooooooooooooooooooooooooooo
ooooooooooooooooooooo


and then try to see the releases with "+albums category", i get this:

[08:20:44]  

 --------- All The Movies -------- 

  03/23/05 -- jiten -- oooooooooooooooooooooooooooooo

 --------- All The Movies --------


It only reads the first line of the multi-line entry.
Can u check that, please?
Thanks in advance...

jiten

Just a question, have u corrected this in the new version?

bastya_elvtars

#16
Newlines are not supported, I would have to rewrite the whole data handling routine again to support. And, why the hell does a file have a multiline name? :P (Releases are files AFAIK. :D)

-- // edit

I use +albums, and get this:

QuoteID: 121 -- 03/03/05 -- [TGA-OP]bastya_elvtars -- music -- MYMUSIC
  ID: 122 -- 03/22/05 -- [TGA-OP]bastya_elvtars -- music -- ehh

 --------- All The Releases --------

I dunno what version you are using.
Everything could have been anything else and it would have just as much meaning.

LiqUiD~TrolL

oki then bastya_elvtars give me the link for the 3.7.5 version

where can i find it?
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

jiten

QuoteOriginally posted by bastya_elvtars
You might want to try this.

-- // edit

Link updated.

There it is...

jiten

QuoteOriginally posted by bastya_elvtars
Newlines are not supported, I would have to rewrite the whole data handling routine again to support. And, why the hell does a file have a multiline name? :P (Releases are files AFAIK. :D)

-- // edit

I use +albums, and get this:

QuoteID: 121 -- 03/03/05 -- [TGA-OP]bastya_elvtars -- music -- MYMUSIC
  ID: 122 -- 03/22/05 -- [TGA-OP]bastya_elvtars -- music -- ehh

 --------- All The Releases --------

I dunno what version you are using.

Well, I'm using freshstuff 3.5 but, with some mods on the way it's supposed to be used.
Mine displays Social Events, The movies that are are on the Cinemas, and Things that are on sale.
As u can see, some of them require multiline entries and it's quite hard to put everything in just a line.
That's why a made this request.
Anyway, thanks for ur support and thanks in advance.

Best regards,

jiten

LiqUiD~TrolL

finaly tnx to bastya_elvtars the script is great ,tnx a lot for your work guys ,you did it really good =)


all my requests is in there !!

bastya_elvtars want something more to work next time ??? 1 more add in the script .when you find time
you sohuld better fix the seach command cause if you search like liquid it doesn t find a release with name Liquid. so you must search it with BIG letter
and it s tough to explain all users what to do

greetings ppl =) liquid was here _!!
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

bastya_elvtars

Fixed. Gonna release as soon as i rewrite command parsing.
Everything could have been anything else and it would have just as much meaning.

LiqUiD~TrolL

hehe bastya_elvtars this script gonna be the perfect script for releases

go go the good work  m8

can t wait for it
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

bastya_elvtars

Released a preview. Check the appropriate topic. :)
Everything could have been anything else and it would have just as much meaning.

LiqUiD~TrolL

apprpriate ?? what you mean?

where is this topic then ???
________<>________


            -=@_ psydream-land.no-ip.org _@=-


             
http://www.psychedelicdreams.bravehost.com

SMF spam blocked by CleanTalk