This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
legaliceit's profile picture

[Lua] (kind of) Rednet-API : Function not working correctly.

Started by legaliceit, 28 October 2012 - 12:02 AM
legaliceit #1
Posted 28 October 2012 - 01:02 AM
Hi :D/>/>
I have wrote some kind of rednet api. Now i found a bug, that makes moving on in the development kind of hard.


The bug is that the function "net.sendConfirmation()" never receives a confirmation.
But for each received rednet message is a confirmation returned.

All functions that have something to do with confirmation are :
  • net.sendConfirmation()
  • net.waitForConfirmation()
  • net.sendAndLetConfirm()
  • net.rednet_messageEvent()
net.rednet_messageEvent() is only sending a confirmation back for each received rednet message.

The function are described better in the code : -> Pastebin <-


If you have time to read through my code, and can help my i would be really grateful!! :)/>/>
ChunLing #2
Posted 28 October 2012 - 01:15 AM
If you pull events for any of the things done preparing to get the confirmation, then you risk discarding the rednet_message event containing the confirmation you're trying get.
legaliceit #3
Posted 28 October 2012 - 01:26 AM
No that can't happen, because rednet messages have in my rednet api sockets. if in the sockettable (net.t_tSocketFunctions) is a entry for that socket it is called. The function net.waitForConfirmation() uses the function net.listen(). net.listen() creates a socketfunction and removes it after a timeout using timer.timeout().
I hope you could understand me. Other Ideas? :D/>/>
ChunLing #4
Posted 28 October 2012 - 05:01 AM
Okay, someone else needs to weigh in on this.