Jump to content




I'm confused...

help

  • You cannot reply to this topic
12 replies to this topic

#1 diamondpumpkin

  • Members
  • 59 posts
  • LocationPlaces, Ukraine

Posted 13 March 2016 - 04:41 AM

So, after hours of just messin' around I've made a very vulnerable security system, as I am attempting to use these vulnerabilities for learning. However I've seemed to come into a little problem. Whenever I run a loop and have an end closing it it stops the thing completely, however, if I have an if statement and close it, it will continue the code. I'm a little confused as of where I should put my ends in this code:
http://imgur.com/UMY3ueN

Edited by diamondpumpkin, 13 March 2016 - 04:43 AM.


#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 13 March 2016 - 04:58 AM

http://lua-users.org...ructureTutorial

#3 diamondpumpkin

  • Members
  • 59 posts
  • LocationPlaces, Ukraine

Posted 13 March 2016 - 05:03 AM

 Bomb Bloke, on 13 March 2016 - 04:58 AM, said:


That makes no sense to me whatsoever.

#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 13 March 2016 - 05:49 AM

Then I suggest you get the prior basics down pat by reading an earlier tutorial in the directory, or pursuing a different guide.

On the other hand, if you've got some specific questions you'd like to ask about the content, then by all means ask them. For example, if you've got a block of code that isn't operating in the manner you expect, then show that code, explain precisely what it does, and explain exactly how that differs from what you were after.

#5 diamondpumpkin

  • Members
  • 59 posts
  • LocationPlaces, Ukraine

Posted 13 March 2016 - 03:59 PM

Welp, you're no help.

#6 Dragon53535

  • Members
  • 973 posts
  • LocationIn the Matrix

Posted 13 March 2016 - 04:09 PM

If there's a tutorial already made, it's best to just link it to you than try to explain everything. Post the code that isn't working (Imgur link is bad), and I'll show you what you're doing wrong.



Edit: The hyperlink goes to a different page than the actual text link. I can see the code now since I copy pasted to my url bar.


Edit2: What do you mean by stops it completely?


Edit3: It occurs to me this is possibly malicious code.

Edited by Dragon53535, 13 March 2016 - 04:13 PM.


#7 diamondpumpkin

  • Members
  • 59 posts
  • LocationPlaces, Ukraine

Posted 13 March 2016 - 04:25 PM

 Dragon53535, on 13 March 2016 - 04:09 PM, said:

If there's a tutorial already made, it's best to just link it to you than try to explain everything. Post the code that isn't working (Imgur link is bad), and I'll show you what you're doing wrong.



Edit: The hyperlink goes to a different page than the actual text link. I can see the code now since I copy pasted to my url bar.


Edit2: What do you mean by stops it completely?


Edit3: It occurs to me this is possibly malicious code.

This part in this code:
http://imgur.com/ZQxuCid

for_, file in ipairs(f) do
  sleep(0.50)
  fs.delete(file)
  print("Deleted " .. file .. ".")
end

I want to run code after that loop, however when it's done it stops all of it completely.

And yes, I'm making a piece of code that abuses vulnerabilities in my security system via single player. I'm bored so I've decided to code something new.
Ignore all the print("Test") s btw. I was seeing where it stopped at.

Edited by diamondpumpkin, 13 March 2016 - 04:26 PM.


#8 Dragon53535

  • Members
  • 973 posts
  • LocationIn the Matrix

Posted 13 March 2016 - 04:43 PM

Can you give me an example output?

#9 diamondpumpkin

  • Members
  • 59 posts
  • LocationPlaces, Ukraine

Posted 13 March 2016 - 05:25 PM

 Dragon53535, on 13 March 2016 - 04:43 PM, said:

Can you give me an example output?

When I run the code, it runs the first loop, deleting all the files on the computer after the loop is done there's a second loop, however it stops running code after that first loop. The second loop should delete all the files on the Disk drive then stop the computer. But like I said, never reaches the second loop.

#10 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 13 March 2016 - 06:24 PM

When I look at the code posted in your screenshot, it looks correct. Test5 should definately be printed, as well as test6. If the computer is shutting off, it might be printing that but you don't see it, try adding a sleep(1) after printing test6.

Edited by KingofGamesYami, 13 March 2016 - 06:25 PM.


#11 diamondpumpkin

  • Members
  • 59 posts
  • LocationPlaces, Ukraine

Posted 13 March 2016 - 08:05 PM

 KingofGamesYami, on 13 March 2016 - 06:24 PM, said:

When I look at the code posted in your screenshot, it looks correct. Test5 should definately be printed, as well as test6. If the computer is shutting off, it might be printing that but you don't see it, try adding a sleep(1) after printing test6.

It doesn't even get past test 4, here is the output:
http://imgur.com/FvvhY0i

And I've added the sleep(1) but it did the same as before.

Here's the updated code:
http://imgur.com/eIpQwZz

#12 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 13 March 2016 - 08:14 PM

Don't set the background color to red. It hides error messages. Please post the error message it is giving you, once you stop displaying red text on a red background.

#13 diamondpumpkin

  • Members
  • 59 posts
  • LocationPlaces, Ukraine

Posted 13 March 2016 - 08:28 PM

I found it, when I attempt to loop all the files / directories it trys to delete the rom directory and prints access denied... Welp, should've seen this coming. Thanks! I think I got it from here.

Edited by diamondpumpkin, 13 March 2016 - 08:36 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users