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

Agoldfish's Gamehub! Play Games, No Messing Around With Pastebin!

Started by Agoldfish, 14 October 2013 - 11:19 AM
Agoldfish #1
Posted 14 October 2013 - 01:19 PM
Agoldfish's GameHub!

Play games without entering pastebin code!!

Have you ever played a Computercraft game, but HATED entering pastebin code? This is for you!

This is version 1.1, with three games!

GAMES IN V1.1: Worm, Mirrors, and EggCracker!

USE AN ADVANCED COMPUTER!

NOTHING ELSE WILL WORK!


DOWNLOADS



SpoilerDownloads on my website: http://pkpoison378.wix.com/agoldfish-programs


CREDITS


SpoilerCREDITS:
ComputerCraftFan11
Made Mirrors!

Hellkid98
Huge code overhaul! (Give him some rep ;D)
Made EggCracker!


Thanks for reading!

Have Fun playing!
TheOddByte #2
Posted 14 October 2013 - 03:35 PM
Well.. I tested it and I know the error where you have to type Mirrors twice to run it, It's because of this
Spoiler

--WORM START
input = io.read()
if input == "Worm"
then
print"Launching worm!"
sleep(2)
shell.run("worm")
end
--MIRRORS START
input = io.read()
if input == "Mirrors"
then
print"Launching Mirrors!"
sleep(2)
shell.run("pastebin get PGSWyuRa Mirrors")
sleep(1)
shell.run("Mirrors")
end
You aren't using any 'elseif' and just using io.read() twice, So the first time it only checks for the input worm, And if it isn't worm in continues to the next read you have, Either use elseifs or have a table that it checks from.

Here's a cleanup for your code


local input = io.read()
	if input == "Worm" then
		print"Launching worm!"
		sleep(2)
		shell.run("worm")

	elseif input == "Mirrors" then
		print"Launching Mirrors!"
		sleep(2)
		shell.run("pastebin get PGSWyuRa Mirrors")
		sleep(1)
		shell.run("Mirrors")
	else -- Here it is if the input wasn't equal to 'Mirrors' or 'Worm'
		print("Incorrect game name entered!")
	end


One tip: Don't overuse sleep, People usually don't like it when there are lots of 'sleep' calls
Agoldfish #3
Posted 14 October 2013 - 04:13 PM
Well.. I tested it and I know the error where you have to type Mirrors twice to run it, It's because of this
Spoiler

--WORM START
input = io.read()
if input == "Worm"
then
print"Launching worm!"
sleep(2)
shell.run("worm")
end
--MIRRORS START
input = io.read()
if input == "Mirrors"
then
print"Launching Mirrors!"
sleep(2)
shell.run("pastebin get PGSWyuRa Mirrors")
sleep(1)
shell.run("Mirrors")
end
You aren't using any 'elseif' and just using io.read() twice, So the first time it only checks for the input worm, And if it isn't worm in continues to the next read you have, Either use elseifs or have a table that it checks from.

Here's a cleanup for your code


local input = io.read()
	if input == "Worm" then
		print"Launching worm!"
		sleep(2)
		shell.run("worm")

	elseif input == "Mirrors" then
		print"Launching Mirrors!"
		sleep(2)
		shell.run("pastebin get PGSWyuRa Mirrors")
		sleep(1)
		shell.run("Mirrors")
	else -- Here it is if the input wasn't equal to 'Mirrors' or 'Worm'
		print("Incorrect game name entered!")
	end


One tip: Don't overuse sleep, People usually don't like it when there are lots of 'sleep' calls
Thank you, I will fix that when I am back on my pc with CC. Also, mind if I use a game or two of yours?
TheOddByte #4
Posted 14 October 2013 - 04:21 PM
Thank you, I will fix that when I am back on my pc with CC. Also, mind if I use a game or two of yours?
Sure you can use the games, Even though they are very old and bad xD
I'm working on two different games atm, One that is a group project and one that I'm making myself, You can add those in to if you want when I've released them ;)/>
Agoldfish #5
Posted 14 October 2013 - 04:48 PM
Thank you, I will fix that when I am back on my pc with CC. Also, mind if I use a game or two of yours?
Sure you can use the games, Even though they are very old and bad xD
I'm working on two different games atm, One that is a group project and one that I'm making myself, You can add those in to if you want when I've released them ;)/>
Thank you ;)/> those games will be in V1.1!
MudkipTheEpic #6
Posted 14 October 2013 - 09:05 PM
That font is too big!

My eyes!

I usually copy and paste those codes…
Agoldfish #7
Posted 15 October 2013 - 09:27 AM
That font is too big!

My eyes!

I usually copy and paste those codes…
I will fix the font. Anywho, you could copy and paste them, but you could also risk not getting the whole code on your clipboard.