Author Topic: Lua Converter ( with GUI )  (Read 12617 times)

0 Members and 1 Guest are viewing this topic.

Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
Lua Converter ( with GUI )
« on: 01 March, 2005, 12:50:50 »
here you all go if you have trouble converting...

this is built with plops converter code, I just built a wxLua GUI.

Lua4 to Lua5 Converter

msvcr70.dll

NOTE: file handlings is not converted....




*Changed*

GUI is updated.

- Fixed so even space strfind and strind( is changed ex.


Enjoy!!!
« Last Edit: 01 March, 2005, 22:16:30 by NightLitch »
//NL

PtokaX forum

Lua Converter ( with GUI )
« on: 01 March, 2005, 12:50:50 »

Offline nEgativE

  • Double Ace
  • *
  • Posts: 146
  • Karma: +6/-4
(No subject)
« Reply #1 on: 01 March, 2005, 12:54:39 »
Oh God, thank U Night ..
LUSA
dc.vasco.srv.br

Offline blackwings

  • Scripter
  • King
  • ******
  • Posts: 986
  • Karma: +12/-8
(No subject)
« Reply #2 on: 01 March, 2005, 17:18:40 »
NL, do you know a safe source to download the "MSVCR70.dll" file?


Offline ARCHANGEL

  • Member
  • ***
  • Posts: 40
  • Karma: +0/-0
(No subject)
« Reply #3 on: 01 March, 2005, 17:22:48 »

Offline blackwings

  • Scripter
  • King
  • ******
  • Posts: 986
  • Karma: +12/-8
(No subject)
« Reply #4 on: 01 March, 2005, 17:41:02 »
the converter is great, but still you need to change the DataArrival() into whatever is needed + code that need to be devided among the new Arrivals.


Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #5 on: 01 March, 2005, 18:47:51 »
Quote
Originally posted by blackwings
the converter is great, but still you need to change the DataArrival() into whatever is needed + code that need to be devided among the new Arrivals.

As I said this is just a simple GUI with plops converter inbuilt to make it easier to some...

But I will try when I have time maybe extend the converter a little bit more...

And divide DataArrival is hard because there is so many diff. way ppl. program the data arrival everyone has its own way.

I might fix the file handling with a little help from plop, with others that can help me.
« Last Edit: 01 March, 2005, 18:49:55 by NightLitch »
//NL

Offline Tw?sT?d-d?v

  • Lord
  • ***
  • Posts: 436
  • Karma: +79/-2
    • EURO-OP
(No subject)
« Reply #6 on: 01 March, 2005, 19:47:31 »
can some1 help me with this error plz  

697: attempt to call global `read' (a nil value)

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 730
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
(No subject)
« Reply #7 on: 01 March, 2005, 21:06:44 »
Quote
Originally posted by (uk)jay
can some1 help me with this error plz  

697: attempt to call global `read' (a nil value)

typical file-handler related error
Everything could have been anything else and it would have just as much meaning.

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 730
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
(No subject)
« Reply #8 on: 01 March, 2005, 21:19:04 »
Seems like a BUG to me, sorry to be the first to report. ;)

From:

Code: [Select]
if user.sMyInfoString and strlen (user.sMyInfoString) > (strlen(user.sName)+13) then
To:

Code: [Select]
if user.sMyInfoString and strlen (user.sMyInfoString) > (string.len(user.sName)+13) then
btw very nice little tool, only thing i WOULD WELCOME is an Exit button when the 'Conversion finished' dialog comes up.
Everything could have been anything else and it would have just as much meaning.

Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #9 on: 01 March, 2005, 22:07:25 »
thx will look into it, and I will add an Exit button...
//NL

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
(No subject)
« Reply #10 on: 02 March, 2005, 00:09:30 »
damn cool boy.
it's gone be a real tuff job 2 convert scripts 2 the new arrivals.
gotta think a lot because i have no idea yet on how do to this.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Offline blackwings

  • Scripter
  • King
  • ******
  • Posts: 986
  • Karma: +12/-8
(No subject)
« Reply #11 on: 02 March, 2005, 04:29:27 »
Quote
Originally posted by plop
damn cool boy.
it's gone be a real tuff job 2 convert scripts 2 the new arrivals.
gotta think a lot because i have no idea yet on how do to this.

plop
NL,plop & American Idiot, this is just a simple idea that might help you guys to solve the problem
with DataArrival() convertion(even if my idea might not work) =
Code: [Select]
01) The converter begins wit searching for smaller parts in the DataArrival().
   (from line 3 in the DataArrival)
02) It finds $To: (saves in memory which line it is)
03) it counts the "if"&"for" from the line it finds $To: until it comes
   to a line with "end"(counts max 1 "if"&"for" per line)
04) Then it counts the "end's" from the when found in "3)" to match the number of "if"&"for" in "3)"
05) Saves in memory which line it found the last "end" counted in "4)"
06) It cuts out those lines an put them inside of a ToArrival().
07) deletes the empty lines in the DataArrival().
08) Makes again a search for things that should be put in seperate Arrival's.(again starts from line 3)
09) When it does find anymore code that should have their own Arrival, it checks line 2.
10) If it found something that identify which the remaining code should go to, it change line 1
    into the proper Arrival.
11) If it doesn't found anything on line 2, then it search for example this =
    Search for this = if,strfind,data  and find this on a single line =
    if( strfind(data, advDetect,1,1) ) then
12) changes line 1 into function ChatArrival()
13) If the DataArrival() doesn't follow this pattern, the convertion won't be made
    (like it found "end" at a line with "if"&"for")
« Last Edit: 02 March, 2005, 04:31:06 by blackwings »


Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #12 on: 02 March, 2005, 09:29:26 »
It is a good idea Blackwing, but in my eyes amd maybe plops time consuming to even try, because ppl. have build their arrivals in different ways...
//NL

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 730
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
(No subject)
« Reply #13 on: 02 March, 2005, 12:37:51 »
Most scripts have their DataArrival strsub-ed, so they use:

Code: [Select]
function DataArrival(user,data)

if strsub(data, 1, 13) == "$ValidateNick" and checknick==1 then >> [color=#FF0000]ValidateNickArrival[/color]
elseif strsub(data, 1, 8) == "$GetINFO" and not user.bOperator then >> [color=#FF0000]GetINFOArrival[/color]
elseif strsub(data, 1, 7) == "$MyINFO" then >> [color=#FF0000]MyINFOArrival[/color]
elseif strsub(data, 1, 7) == "$UserIP" then >> [color=#FF0000]UserIPArrival[/color]
elseif strsub(data, 1, 4) == "$To:" then >> [color=#FF0000]ToArrival[/color]
elseif(strsub(data, 1, 12) == "$OpForceMove") then >> [color=#FF0000]OpForceMoveArrival[/color]
elseif(strsub(data, 1, 5) == "$Kick") then >> [color=#FF0000]KickArrival[/color]
elseif strsub(data, 1, 1) == "<" then >> [color=#FF0000]ChatArrival[/color]

Now you just omit the DataArrival and convert the crap as i wrote. The whole damn thing would not take 5 mins. And manual conversion is the safest IMHO in cases like this.
Everything could have been anything else and it would have just as much meaning.

Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #14 on: 02 March, 2005, 19:06:22 »
I will make a try tomorrow or Friday when I might feeling better....

Going to have an operation on my feets tomorrow, so I guess I need to have my feets high so not to much blood is streaming... heh...

But I'll be around...
//NL

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 730
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
(No subject)
« Reply #15 on: 02 March, 2005, 19:20:12 »
Quote
Originally posted by NightLitch
I will make a try tomorrow or Friday when I might feeling better....

Going to have an operation on my feets tomorrow, so I guess I need to have my feets high so not to much blood is streaming... heh...

But I'll be around...

This was intended for blackwings... ;P
Everything could have been anything else and it would have just as much meaning.

Offline kepp

  • Scripter
  • King
  • ******
  • Posts: 790
  • Karma: +2/-0
(No subject)
« Reply #16 on: 05 March, 2005, 16:26:03 »
Nice work NL, maybe some improvements can be done

Code: [Select]
function UpdateLogs()
   --// Code --\\
end

Turns out

Code: [Select]
function Upos.dateLogs()
   --// Code --\\
end

Same goes for comments
« Last Edit: 05 March, 2005, 16:26:28 by kepp »
Guarding    

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 730
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
(No subject)
« Reply #17 on: 05 March, 2005, 16:56:30 »
Yes, and substance goes to subsmath.tance.  :D
Everything could have been anything else and it would have just as much meaning.

Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #18 on: 05 March, 2005, 17:15:38 »
Quote
Originally posted by kepp
Nice work NL, maybe some improvements can be done

Code: [Select]
function UpdateLogs()
   --// Code --\\
end

Turns out

Code: [Select]
function Upos.dateLogs()
   --// Code --\\
end

Same goes for comments

sure Am on it
//NL

Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #19 on: 05 March, 2005, 19:44:11 »
*** Converter Updated ***

- Added simple converter for reading files converter
- Fixed errors in code when changing word inside a word

*** Download ***
//NL

Offline Mardeg

  • Forum Ace
  • *****
  • Posts: 75
  • Karma: +7/-1
    • The most bloated human-readable email hider in the world!
(No subject)
« Reply #20 on: 11 March, 2005, 20:49:31 »
In --commented lines words like "format" and "remove" were changed to "string.format" and "os.remove". Comments should be exempt from conversion, no?

Inside "" strings, "A Mardeg script" was changed to "A Marmath.deg script". Fixable?

In a variable declaration:
  leechlog = "path/to/leecher.log"
was changed to
  leechmath.log = "path/to/leecher.log"

Offline NightLitch

  • Emperor
  • **
  • Posts: 1 455
  • Karma: +16/-0
(No subject)
« Reply #21 on: 11 March, 2005, 20:52:31 »
Thx will look deeper, but have you tried the newest or the old one ???

thought I had fixed that ??

-- comments and "strings" I can look into more... When I get the time...
//NL

Offline Mardeg

  • Forum Ace
  • *****
  • Posts: 75
  • Karma: +7/-1
    • The most bloated human-readable email hider in the world!
(No subject)
« Reply #22 on: 12 March, 2005, 10:55:52 »
I used the download link in your post above.
Also noticed it missed changing write( to io.write(
and t.remove changed to tos.remove instead of table.remove
It's still a great tool though :)
« Last Edit: 12 March, 2005, 10:56:51 by Mardeg »

Offline BeeR

  • Lord
  • ***
  • Posts: 283
  • Karma: +2/-0
(No subject)
« Reply #23 on: 13 March, 2005, 15:52:03 »
HI alles :]
did try to convert my bots and gets this result:
attempt to perform arithmetic on global `min' (a nil value)

any ide ?? i guess it has something to do with the timer
--> StartTimer() <--
« Last Edit: 13 March, 2005, 16:01:47 by BeeR »
A cold BeeR is stunning !!

Offline LiqUiD~TrolL

  • Triple Ace
  • **
  • Posts: 160
  • Karma: +0/-0
hello everyone
« Reply #24 on: 15 March, 2005, 17:12:59 »
good day my mates well i ve used this converter and i added the scripts in ptoka x


but something is wrong here is my message in the ptoka x   :

No syntax errors in script file AnTiFlooD By PloP_(4.5.4).lua5.lua
No syntax errors in script file modem_(no_slow_connections allowed).lua5.lua
No syntax errors in script file plop2_(6txt files).lua5.lua
No syntax errors in script file random_intro_outro.lua5.lua
Syntax ...emp\Rar$EX07.765\scripts\redirectprotection.lua5.lua:63: attempt to index global `checkAdmath' (a nil value)
No syntax errors in script file Release_Bot1 plop 3.2_(VIPS can add releases).lua5.lua
No syntax errors in script file RoboCopv10.01.lua
No syntax errors in script file zRightClicker.lua
Syntax ...lease_Bot1 plop 3.2_(VIPS can add releases).lua5.lua:221: attempt to call global `readfrom' (a nil value)
Syntax ...$EX07.765\scripts\AnTiFlooD By PloP_(4.5.4).lua5.lua:167: attempt to call method `EnableFullData' (a nil value)
________<>________


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


             
http://www.psychedelicdreams.bravehost.com

PtokaX forum

hello everyone
« Reply #24 on: 15 March, 2005, 17:12:59 »