Jump to content




Issue in making a random code system


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

#1 Reinified

  • Members
  • 30 posts

Posted 06 May 2017 - 06:50 PM

EDITED VERSION!

I decided that I would like to add an extra level of security by making sure that the PC does not leave the offices of the place the PC was intended to be used.

I decided that I would do this with a type of proximity detector, using RedNet.

This is the HOST computer's view. The computer would be run by a network admin.

It will produce an error "expected number".
Why is this?!

Here is the code I have:
https://pastebin.com/ZMxDVT62

Help, please!

Edited by Reinified, 07 May 2017 - 04:40 PM.


#2 KingofGamesYami

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

Posted 06 May 2017 - 07:45 PM

Considering you don't have any loops, I don't see how that 'break' could possibly work.

#3 Dog

  • Members
  • 1,179 posts
  • LocationEarth orbit

Posted 06 May 2017 - 08:09 PM

Also, note that 'decode' is a number and read() returns a string - you'll probably want to tonumber() your read call.

#4 Reinified

  • Members
  • 30 posts

Posted 07 May 2017 - 05:04 AM

Thanks both of you! I found that the correct way is
tonumber(read("*"))

:D

#5 Reinified

  • Members
  • 30 posts

Posted 07 May 2017 - 04:41 PM

I edited it to be a different question related to the same topic. Any answers?

#6 KingofGamesYami

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

Posted 07 May 2017 - 04:59 PM

Which line does the error occur on?

#7 Anavrins

  • Members
  • 775 posts

Posted 07 May 2017 - 11:41 PM

Line 3, you didn't specify an ID for rednet.send

#8 Dog

  • Members
  • 1,179 posts
  • LocationEarth orbit

Posted 08 May 2017 - 12:09 AM

You can also remove the tonumber(id) since rednet returns a number for the id and you aren't capturing the output of tonumber() for use anyway.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users