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

Warpdrive Mod Continual Ping Program

Started by Bobby, 18 March 2018 - 03:43 AM
Bobby #1
Posted 18 March 2018 - 04:43 AM
I'm pretty new to Lua programming, so I hope you all treat me gently!
This is a little program I wrote to ping continually with the radar from the Warpdrive mod.
It will ask for radius, and whether or not you want to use a monitor.
If you choose to use a monitor, it will ask which side it is on.
Once you start it, it will loop forever, or until you terminate it with Ctrl-T.
You can get it with

pastebin get QjwmFE3p
If anyone has suggestions or problems, please tell me!
Very important! Once you run it for the first time you can't edit anything else on that computer!!
I don't know why, but I'm trying to figure it out. In the meantime, only use this on
computers where you don't plan on editing anything.
Edited on 18 March 2018 - 04:43 PM
Purple #2
Posted 18 March 2018 - 08:53 AM
Have you tried editing it manually by opening the text file in your worlds save folder?
Bobby #3
Posted 18 March 2018 - 05:42 PM
Have you tried editing it manually by opening the text file in your worlds save folder?

Yes, that works and I also copied it to another CC computer to do it there where you can edit it just fine. I can't seem to crack what is causing it.
After I run it for the first time, I am prevented from editing this or any other program on that specific computer. I can still copy and delete them, so
I can just copy them to another computer and edit them there, deleting the original before I copy it back. I am, however, still trying to figure it out.
Lupus590 #4
Posted 19 March 2018 - 09:37 AM
Are you using local variables? If not then the leftover globals may be the issue.
SuperDyl19 #5
Posted 19 March 2018 - 03:30 PM
Here's a link for reference: https://pastebin.com/QjwmFE3P

Global variables are used, but their given new values so I doubt that's the issue. Still, it's good practice to make variables local to avoid issues and for all I know it could be an issue.

Good luck!
Dog #6
Posted 19 March 2018 - 03:52 PM
I didn't see any obvious indicators in the code you posted as to why this is happening; but that code also runs 'ping' which, as far as I know, isn't included with ComputerCraft. Can you please also post the code for your ping program as well?
Bobby #7
Posted 26 March 2018 - 10:33 PM
Sorry for taking so long to get back here.

global variables
I did try this, that just requires putting local before the variable right? Like

local m=io.read()

my ping program
It's not my program, it is packaged with the Radar in the WarpDrive mod. I did however upload it to pastebin so you could see it. https://pastebin.com/vnEqq9Z0