Jump to content




Some lua tricks you may not have known...


106 replies to this topic

#101 SquidDev

    Frickin' laser beams | Resident Necromancer

  • Members
  • 1,427 posts
  • LocationDoes anyone put something serious here?

Posted 26 May 2015 - 08:37 PM

View PostThefdjurt, on 26 May 2015 - 07:22 PM, said:

Cool stuffs (even though I knew it all ;)), but this link
is dead.
GitHub's current page system requires you to create a new project then create a branch named "gh-pages"-- I recommend setting this as the default branch-- , and finally then add an "index.html" file.

No, the creator deleted their site. You can browse the old code here though (or through the wayback machine)

Edited by SquidDev, 26 May 2015 - 08:38 PM.


#102 Waitdev_

  • Members
  • 432 posts
  • LocationAdelaide

Posted 12 July 2015 - 02:57 PM

i thought i might point out with fs api,
try doing this
f = fs.open("file","w")
f.writeLine [[
--comment :P/>/>
function()
random lines n' stuff
lots of lines, so much lols!
]]
f.close()
and that writes to a file

Edited by Wait_, 16 July 2015 - 03:56 AM.


#103 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 12 July 2015 - 08:29 PM

View PostWait_, on 12 July 2015 - 02:57 PM, said:

i thought i might point out with fs api,
try doing this
f = f.open("file","w")
f.writeLine [[
--comment :P/>/>
function()
random lines n' stuff
lots of lines, so much lols!
]]
f.close()
and that writes to a file

I don't really see what you're trying to point out here. Could you elaborate more?

#104 flaghacker

  • Members
  • 655 posts

Posted 13 July 2015 - 09:54 PM

View PostWait_, on 12 July 2015 - 02:57 PM, said:

i thought i might point out with fs api,
try doing this
f = f.open("file","w")
f.writeLine [[
--comment :P/>/>
function()
random lines n' stuff
lots of lines, so much lols!
]]
f.close()
and that writes to a file

should be fs.open

#105 Waitdev_

  • Members
  • 432 posts
  • LocationAdelaide

Posted 16 July 2015 - 03:55 AM

what i'm saying is, when you pointed out the multi-line print,
print [[
this prints multi line stuff
this is a second line
]]
i noticed it also works with fs.writeLine()
fs.writeLine [[
this is line 1
this is line 2
]]


#106 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 16 July 2015 - 06:29 AM

That's because it's simply a Lua's multiline string. It will work with anything that requires strings, because a multiline string is exactly the same as a non-multiline string. The only difference is that you can embed special characters into a multiline string without escaping them, such as newline characters.

#107 AoD

  • Members
  • 38 posts

Posted 27 July 2015 - 08:05 PM

OMG thats a few tricks there lol bookmarked as this must come is handy at some point thanks for posting such an array of alternate coding techniques :)

Thanks OP





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users