Jump to content




[help]wireless peripheral api


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

#21 KingofGamesYami

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

Posted 07 May 2014 - 10:33 PM

View PostBomb Bloke, on 07 May 2014 - 10:24 PM, said:

Hmm. Can't really see a problem there, but there's a missing "then" on line 28.

By the way, aren't all args guarenteed to be strings - I'm not sure why you're checking for this? I also got the impression modem.open() doesn't take them - wouldn't you need to use tonumber(args[1])?

Yeah, the problem I was having was on line 22, the slave has been completely debugged now.. however the actual api is being annoying >.< I wish there was an emulator (for mac) that I could test this particular code on...

One of the problems was the tonumber thing, I simply added
args[1] = tunumber(args[1])
args[2] = tonumber(args[2])

Also, when I coded the checking thing I wasn't sure how command line arguments work. I thought they would have to do "top" to generate a string, instead of plain top.

If you care to look through the code, the error is expected ')' on line 21 in my "main" script.

#22 Bomb Bloke

    Hobbyist Coder

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

Posted 07 May 2014 - 10:49 PM

This may be what you're after. Runs in your web browser, can access Pastebin and everything.

On line 19 you've got this:

(#args = 1 and args[1] = "wpe")

... when you should have this:


(#args == 1 and args[1] == "wpe")


#23 KingofGamesYami

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

Posted 07 May 2014 - 11:02 PM

View PostBomb Bloke, on 07 May 2014 - 10:49 PM, said:

This may be what you're after. Runs in your web browser, can access Pastebin and everything.
problem is, cant use peripherals (wireless modems). This means my code will error every time I try to call the modem... which defeats the purpose of testing.

#24 KingofGamesYami

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

Posted 08 May 2014 - 09:20 PM

I am now getting:
Cannot serialize function
on my slave:
Spoiler

if I don't serialize, my main program breaks

Spoiler

Edited by KingofGamesYami, 08 May 2014 - 09:20 PM.


#25 CometWolf

  • Members
  • 1,283 posts

Posted 08 May 2014 - 09:53 PM

You don't need to serialize tables to send them via rednet, but the functions won't work either way. What you want is the name of the functions, not the functions themselves.

#26 KingofGamesYami

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

Posted 12 May 2014 - 10:40 PM

Reviving topic, new problem, updated code... but don't feel like making another post in ask-a-pro

Anyway, my test program is now freezing up, and won't get past using wrap("left", 204, 204). I believe the problem is in the api, considering I *tried* to add some code to prevent random messages from messing it up(not that that was likely anyway, as the data was exchanged within... idk how short of a time XD). I know the slave is sending the table, since I added 'print' into the code as a bonus debug feature (i will enable/disable this later).

api
slave






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users