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

[Question] Detecting color of a clicked pixel?

Started by Mackan90096, 07 May 2013 - 02:17 AM
Mackan90096 #1
Posted 07 May 2013 - 04:17 AM
Hi! I'm making a game using colors.
When I click a pixel I want a value to get higher.
So, if the pixel is for example yellow and I have 4 different color values.. Can I in any way detect if the color of the pixel clicked is yellow?
Frederikam #2
Posted 07 May 2013 - 05:17 AM
Pretty sure that's not possible to detect in CC. You need to save the information in a variable (or in case of a lot variables use tables).
Mackan90096 #3
Posted 07 May 2013 - 05:46 AM
Ok.. How do I do that?
Frederikam #4
Posted 07 May 2013 - 06:09 AM
Ok.. How do I do that?

Well just put any data you change into a variable. Like when you start the game and set a pixel to a specific color, make sure you save what color that exact pixel is. Also when you change the color of a pixel.
LordIkol #5
Posted 07 May 2013 - 06:20 AM
Take a look into the Gem Miner Programm it is exactly doing what you request.
It stores the Color and the coordinates in a table to determine the score value.

You should know that cause you released the game ;D
Mackan90096 #6
Posted 07 May 2013 - 06:32 AM
Take a look into the Gem Miner Programm it is exactly doing what you request.
It stores the Color and the coordinates in a table to determine the score value.

You should know that cause you released the game ;D

True.. But only like 10% of that code is completly mine..
LordIkol #7
Posted 07 May 2013 - 07:04 AM
Take a look into the Gem Miner Programm it is exactly doing what you request.
It stores the Color and the coordinates in a table to determine the score value.

You should know that cause you released the game ;D

True.. But only like 10% of that code is completly mine..

And thats a good Example why its bad to be a coding Monkey instead of bringing people to the point where they can do the things on their own :)/>

I will later add an explenation about how to save position and color to a table now i go to lunch :)/>
Mackan90096 #8
Posted 07 May 2013 - 07:14 AM
Take a look into the Gem Miner Programm it is exactly doing what you request.
It stores the Color and the coordinates in a table to determine the score value.

You should know that cause you released the game ;D

True.. But only like 10% of that code is completly mine..

And thats a good Example why its bad to be a coding Monkey instead of bringing people to the point where they can do the things on their own :)/>

I will later add an explenation about how to save position and color to a table now i go to lunch :)/>

Alright, thanks :)/>
Smiley43210 #9
Posted 07 May 2013 - 07:50 AM
Think of coordinates in a plane. Just use "coordinate" keys in a table. myTable[x][y]. Familiar looking, right? Now, you need to be able to set it first, right? Well, we do that in "local gem = {x, y, color}". And remember that the data for each gem is stored in one table, the "gems" table. So to get the color of a gem, we need to reference that table, and grab a "gem data table". Look to where we put "– Do stuff here, – Do more stuff here". In there is the part where we figure out which gem was clicked on. It handles the referencing and stuff. v[1], v[2], and v[3] all represent the three values of a gem: Its x-coordinate, y-coordinate, and color. So you'd use v[3] to get the color of the gem.

I know that may not have made much sense to you, sorry about that :unsure:/>. I'm about to go to bed. Worst time to try to explain things. But I hope it helped a little. Maybe when lord gets back, he can provide a much better explanation :P/>. An explanation that details saving colors in a table from scratch, instead of referencing your existing code.
1lann #10
Posted 07 May 2013 - 07:51 AM
Just wanted to say, there are multiple ways of implementing this. Implementing this in a more specific way instead of a general process would probably optimize and make it easier to code. Can you give us a more specifics on what you're trying to do?
Mackan90096 #11
Posted 07 May 2013 - 08:17 AM
Think of coordinates in a plane. Just use "coordinate" keys in a table. myTable[x][y]. Familiar looking, right? Now, you need to be able to set it first, right? Well, we do that in "local gem = {x, y, color}". And remember that the data for each gem is stored in one table, the "gems" table. So to get the color of a gem, we need to reference that table, and grab a "gem data table". Look to where we put "– Do stuff here, – Do more stuff here". In there is the part where we figure out which gem was clicked on. It handles the referencing and stuff. v[1], v[2], and v[3] all represent the three values of a gem: Its x-coordinate, y-coordinate, and color. So you'd use v[3] to get the color of the gem.

I know that may not have made much sense to you, sorry about that :unsure:/>. I'm about to go to bed. Worst time to try to explain things. But I hope it helped a little. Maybe when lord gets back, he can provide a much better explanation :P/>. An explanation that details saving colors in a table from scratch, instead of referencing your existing code.

Thanks for explaining..
And yeah, it is a bit confusing but I'll work it out. :)/>



Just wanted to say, there are multiple ways of implementing this. Implementing this in a more specific way instead of a general process would probably optimize and make it easier to code. Can you give us a more specifics on what you're trying to do?

I'm trying to make a game where you click pixels of the colors;

Yellow
lightBlue
orange
lime

if you click a yellow gem i want the variable yellowGems to increase.
Engineer #12
Posted 07 May 2013 - 08:49 AM
Okay, first of all, lets create a table

local screen = {}

Now we want to be able to fill in the x and y and then get the color, right?
So in short:

local event, button, x, y = os.pullEvent("mouse_click")
screen[x][y] -- We want to accomplish this, and that returns the color of that pixel
-- But if we fill it in like this:
screen[y][x]
--It will be less tables in a table. I think its just a good practice

So, lets first set the whole screen using loops:

local width, height = term.getSize() -- get the screen values

for i = 1, height do -- simple loop
   screen[i] = {} -- create a table for each height
   for j = 1, width do -- another loop, different variable though
	   screen[i][j] = colors.black
	   -- So we set the first index to table we just created. And the second one is
	   -- for the index for that table
   end
end

Now you table essentially looks like this:

local screen = {
  [1] = { colors.black, colors.black, colors.black, --[[ etc. for the width ]] },
  [2] = { --[[see index 1, its the same]] },
  --etc..

Now you can easily get the color of that pixel:

local event, button, x, y = os.pullEvent("mouse_click")
local colorClicked = screen[y][x]
It returns in the form of a number, so then you can create another table wich sets all the colors. This is confusing, but this part you must take for granted, at least, the loop. If you dont know what Im doing with the table, just ask again :P/>


local color = {} -- notice this is not colors, if you use colors, you are overwriting stuff and thats bad
for k, v in pairs(colors) do -- look this loop up on the interwebs :3
   color[v] = k
end

-- Now we can get the real color:
local event, button, x, y = os.pullEvent("mouse_click")
local colorClicked = color[ screen[y][x] ] -- we set the index of color to the pixel. 
                                           -- So assuming the color was black, there actuall stands:
                                           -- color[ 32768 ], and that will return the string "black"

And now you should be able to write functions to set a pixel, to render the screen (background wise).
Hmm.. Not sure if you know how you should do it.. Ask further if you get stuck again with this, but only ig you get stuck again.
Not if you want to write us your code.
Edited on 07 May 2013 - 06:58 AM
Kingdaro #13
Posted 07 May 2013 - 09:26 AM
I would prefer to use a table of objects as opposed to a map of pixels onscreen, as it's way easier to manage and much faster to loop through.
Engineer #14
Posted 07 May 2013 - 09:47 AM
I would prefer to use a table of objects as opposed to a map of pixels onscreen, as it's way easier to manage and much faster to loop through.

But you dont have to loop through the table, at least for getting the color of that specific pixel. If you want to render it, you could make a 'changes' table and render only the difference between the previous screen. Its as easy as that :P/>
Mackan90096 #15
Posted 07 May 2013 - 10:03 AM
Well, with one pixel clicked, I want it to dissapear, add to the value, and spawn a new.
I have the spawning thing done.
LordIkol #16
Posted 07 May 2013 - 01:00 PM
Well, with one pixel clicked, I want it to dissapear, add to the value, and spawn a new.
I have the spawning thing done.

ok so post your code cause the Spawning is an important part of getting the color then i will try to get you on the right path to implement the color detection thing
Mackan90096 #17
Posted 07 May 2013 - 02:17 PM
Code:



function playGame()
-- Variables --
slc = 1
minX = 13
maxX = w-1
minY = 2
maxY = h-1
maxGem = 20
spawnedGems = 0
newX = math.random(minX, maxX)
newY = math.random(minY, maxY)
local function frame()
term.setBackgroundColor(colors.black)
term.clear()
paintutils.drawLine(12, 1, 12, h, colors.red)
paintutils.drawLine(12, 1, w, 1, colors.red)
paintutils.drawLine(12, h, w, h, colors.red)
paintutils.drawLine(w, 1, w, h, colors.red)
paintutils.drawLine(1, 1, 1, h, colors.red)
paintutils.drawLine(1, 1, 1, h, colors.red)
paintutils.drawLine(2, 1, 2, h, colors.red)
paintutils.drawLine(3, 1, 3, h, colors.red)
paintutils.drawLine(4, 1, 4, h, colors.red)
paintutils.drawLine(5, 1, 5, h, colors.red)
paintutils.drawLine(6, 1, 6, h, colors.red)
paintutils.drawLine(7, 1, 7, h, colors.red)
paintutils.drawLine(8, 1, 8, h, colors.red)
paintutils.drawLine(9, 1, 9, h, colors.red)
paintutils.drawLine(10, 1, 10, h, colors.red)
paintutils.drawLine(11, 1, 11, h, colors.red)
term.setBackgroundColor(colors.lime)
term.setTextColor(colors.black)
term.setCursorPos(5, h-4)
print(" Exit ")
end
function spawnGem()
 if spawnedGems >= maxGem then
    playGame()
else
     paintutils.drawPixel(newX, newY, color)
     spawnedGems = spawnedGems + 1
     gem()
end
end




function gem()
while true do
newX = math.random(minX, maxX)
newY = math.random(minY, maxY)
colorNum = math.random(1,4)
    if colorNum == 1 then
    color = colors.orange
    spawnGem()
elseif colorNum == 2 then
    color = colors.yellow
    spawnGem()
elseif colorNum == 3 then
    color = colors.lime
    spawnGem()
elseif colorNum == 4 then
    color = colors.lightBlue
    spawnGem()
end
end
end
frame()
gem()
end
LordIkol #18
Posted 07 May 2013 - 02:46 PM
did you test that code?
cause its not working the way you posted it.

1. the function playGame is useless cause you can not just wrap a function around the whole code remove it and create it seperatly
2. the variables w and h are not assigned use term.getSize() to assign them.
3. what is playgame supposed to do?

and before you start fixing it tell me why you not use the GemMiner programm cause actually this is doing the exact same thing.
Its even looking the same
Mackan90096 #19
Posted 08 May 2013 - 01:40 AM
Well… Here's my full code:

And I'm not using the GemMiner code because it doesn't work as i want it to.. (And I dont understand it completely)

Spoiler


-- Variables --
debug = "Debug"
w, h = term.getSize()

-- Values --

limeName = "Lime gem: "
limeSell = 10
lblueName = "Light blue gem: "
lblueSell = 15
yellowName = "Yellow gem: "
yellowSell = 50
orangeName = "Orange gem: "
orangeSell = 100

-- Stats --
money = 0
playerName = "nil"
limeGems = 0
lblueGems = 0
yellowGems = 0
orangeGems = 0
-- End Stats --

-- End Variables --
-- Game --

function playGame()
-- Variables --
slc = 1
minX = 13
maxX = w-1
minY = 2
maxY = h-1
maxGem = 20
spawnedGems = 0
newX = math.random(minX, maxX)
newY = math.random(minY, maxY)
local function frame()
term.setBackgroundColor(colors.black)
term.clear()
paintutils.drawLine(12, 1, 12, h, colors.red)
paintutils.drawLine(12, 1, w, 1, colors.red)
paintutils.drawLine(12, h, w, h, colors.red)
paintutils.drawLine(w, 1, w, h, colors.red)
paintutils.drawLine(1, 1, 1, h, colors.red)
paintutils.drawLine(1, 1, 1, h, colors.red)
paintutils.drawLine(2, 1, 2, h, colors.red)
paintutils.drawLine(3, 1, 3, h, colors.red)
paintutils.drawLine(4, 1, 4, h, colors.red)
paintutils.drawLine(5, 1, 5, h, colors.red)
paintutils.drawLine(6, 1, 6, h, colors.red)
paintutils.drawLine(7, 1, 7, h, colors.red)
paintutils.drawLine(8, 1, 8, h, colors.red)
paintutils.drawLine(9, 1, 9, h, colors.red)
paintutils.drawLine(10, 1, 10, h, colors.red)
paintutils.drawLine(11, 1, 11, h, colors.red)
term.setBackgroundColor(colors.lime)
term.setTextColor(colors.black)
term.setCursorPos(5, h-4)
print(" Exit ")
end
function spawnGem()
if spawnedGems >= maxGem then
	playGame()
else
	 paintutils.drawPixel(newX, newY, color)
	 spawnedGems = spawnedGems + 1
	 gem()
end
end




function gem()
while true do
newX = math.random(minX, maxX)
newY = math.random(minY, maxY)
colorNum = math.random(1,4)
	if colorNum == 1 then
	color = colors.orange
	spawnGem()
elseif colorNum == 2 then
	color = colors.yellow
	spawnGem()
elseif colorNum == 3 then
	color = colors.lime
	spawnGem()
elseif colorNum == 4 then
	color = colors.lightBlue
	spawnGem()
end
end
end
frame()
gem()
end




function frame2()
slc = 0
term.setBackgroundColor(colors.white)
term.clear()
term.setCursorPos(math.floor(w-string.len("Logged in as: "..playerName))/2, 2)
print("Logged in as: "..playerName )
paintutils.drawPixel(1, 4, 32)
paintutils.drawPixel(1, 6, 8)
paintutils.drawPixel(1, 8, 16)
paintutils.drawPixel(1, 10, 2)
term.setBackgroundColor(1)
term.setCursorPos(3, 4)
print(limeName ..limeGems)
term.setCursorPos(3, 6)
print(lblueName ..lblueGems)
term.setCursorPos(3, 8)
print(yellowName ..yellowGems)
term.setCursorPos(3, 10)
print(orangeName ..orangeGems)
term.setBackgroundColor(32)
term.setCursorPos(10, 15)
print("Play")
term.setCursorPos(20, 15)
print("Sell Gems")
end


function game()
term.clear()
term.setBackgroundColor(1)
term.setTextColor(32768)
term.clear()
term.setCursorPos(math.floor(w-string.len("Name: "))/2, 2)
write("Name: ")
playerName = read()
if playerName == "" then
game()
else
frame2()
end
end



-- End Functions --

game()

-- User Interaction --

while true do
		event, key, x, y = os.pullEvent()
		if event == "mouse_click" then
		if slc == 0 then
		if  x >= 10 and x <= 18 and y == 15 and key == 1 then
		 playGame()
		elseif x >= 20 and x <= 30 and y == 15 and key == 1 then
		 sellGems()
		elseif slc == 1 then
			if x >= 5 and x <= 10 and y == h-4 and key == 1 then
				slc = 0
				frame2()
end
end
end
end			
end
Engineer #20
Posted 08 May 2013 - 06:15 AM
I have re-indented it for you because.. It wasnt intendented properly :P/>/>
Spoiler

-- Variables --
debug = "Debug"
w, h = term.getSize()

-- Values --

limeName = "Lime gem: "
limeSell = 10
lblueName = "Light blue gem: "
lblueSell = 15
yellowName = "Yellow gem: "
yellowSell = 50
orangeName = "Orange gem: "
orangeSell = 100

-- Stats --
money = 0
playerName = "nil"
limeGems = 0
lblueGems = 0
yellowGems = 0
orangeGems = 0
-- End Stats --

-- End Variables --
-- Game --

function playGame()
    -- Variables --
    slc = 1
    minX = 13
    maxX = w-1
    minY = 2
    maxY = h-1
    maxGem = 20
    spawnedGems = 0
    newX = math.random(minX, maxX)
    newY = math.random(minY, maxY)
    local function frame()
        term.setBackgroundColor(colors.black)
        term.clear()
        paintutils.drawLine(12, 1, 12, h, colors.red)
        paintutils.drawLine(12, 1, w, 1, colors.red)
        paintutils.drawLine(12, h, w, h, colors.red)
        paintutils.drawLine(w, 1, w, h, colors.red)
        paintutils.drawLine(1, 1, 1, h, colors.red)
        paintutils.drawLine(1, 1, 1, h, colors.red)
        paintutils.drawLine(2, 1, 2, h, colors.red)
        paintutils.drawLine(3, 1, 3, h, colors.red)
        paintutils.drawLine(4, 1, 4, h, colors.red)
        paintutils.drawLine(5, 1, 5, h, colors.red)
        paintutils.drawLine(6, 1, 6, h, colors.red)
        paintutils.drawLine(7, 1, 7, h, colors.red)
        paintutils.drawLine(8, 1, 8, h, colors.red)
        paintutils.drawLine(9, 1, 9, h, colors.red)
        paintutils.drawLine(10, 1, 10, h, colors.red)
        paintutils.drawLine(11, 1, 11, h, colors.red)
        term.setBackgroundColor(colors.lime)
        term.setTextColor(colors.black)
        term.setCursorPos(5, h-4)
        print(" Exit ")
    end
    function spawnGem()
        if spawnedGems >= maxGem then
            playGame()
        else
            paintutils.drawPixel(newX, newY, color)
            spawnedGems = spawnedGems + 1
            gem()
        end
    end




    function gem()
        while true do
            newX = math.random(minX, maxX)
            newY = math.random(minY, maxY)
            colorNum = math.random(1,4)
            if colorNum == 1 then
                color = colors.orange
                spawnGem()
            elseif colorNum == 2 then
                color = colors.yellow
                spawnGem()
            elseif colorNum == 3 then
                color = colors.lime
                spawnGem()
            elseif colorNum == 4 then
                color = colors.lightBlue
                spawnGem()
            end
        end
    end
    frame()
    gem()
end

function frame2()
    slc = 0
    term.setBackgroundColor(colors.white)
    term.clear()
    term.setCursorPos(math.floor(w-string.len("Logged in as: "..playerName))/2, 2)
    print("Logged in as: "..playerName )
    paintutils.drawPixel(1, 4, 32)
    paintutils.drawPixel(1, 6, 8)
    paintutils.drawPixel(1, 8, 16)
    paintutils.drawPixel(1, 10, 2)
    term.setBackgroundColor(1)
    term.setCursorPos(3, 4)
    print(limeName ..limeGems)
    term.setCursorPos(3, 6)
    print(lblueName ..lblueGems)
    term.setCursorPos(3, 8)
    print(yellowName ..yellowGems)
    term.setCursorPos(3, 10)
    print(orangeName ..orangeGems)
    term.setBackgroundColor(32)
    term.setCursorPos(10, 15)
    print("Play")
    term.setCursorPos(20, 15)
    print("Sell Gems")
end

function game()
    term.clear()
    term.setBackgroundColor(1)
    term.setTextColor(32768)
    term.clear()
    term.setCursorPos(math.floor(w-string.len("Name: "))/2, 2)
    write("Name: ")
    playerName = read()
    if playerName == "" then
        game()
    else
        frame2()
    end
end

-- End Functions --

game()

-- User Interaction --

while true do
    event, key, x, y = os.pullEvent()
    if event == "mouse_click" then
        if slc == 0 then
            if  x >= 10 and x <= 18 and y == 15 and key == 1 then
                playGame()
            elseif x >= 20 and x <= 30 and y == 15 and key == 1 then
                sellGems()
            elseif slc == 1 then
                if x >= 5 and x <= 10 and y == h-4 and key == 1 then
                    slc = 0
                    frame2()
                end
            end
        end
    end                     
end

Also when you dont understand the logic of your own game… Still dont get why …then you really should start smaller and train up until you can program such things.
Edited on 08 May 2013 - 04:15 AM
Mackan90096 #21
Posted 08 May 2013 - 06:24 AM
I have re-indented it for you because.. It wasnt intendented properly :P/>/>
Spoiler

-- Variables --
debug = "Debug"
w, h = term.getSize()

-- Values --

limeName = "Lime gem: "
limeSell = 10
lblueName = "Light blue gem: "
lblueSell = 15
yellowName = "Yellow gem: "
yellowSell = 50
orangeName = "Orange gem: "
orangeSell = 100

-- Stats --
money = 0
playerName = "nil"
limeGems = 0
lblueGems = 0
yellowGems = 0
orangeGems = 0
-- End Stats --

-- End Variables --
-- Game --

function playGame()
	-- Variables --
	slc = 1
	minX = 13
	maxX = w-1
	minY = 2
	maxY = h-1
	maxGem = 20
	spawnedGems = 0
	newX = math.random(minX, maxX)
	newY = math.random(minY, maxY)
	local function frame()
		term.setBackgroundColor(colors.black)
		term.clear()
		paintutils.drawLine(12, 1, 12, h, colors.red)
		paintutils.drawLine(12, 1, w, 1, colors.red)
		paintutils.drawLine(12, h, w, h, colors.red)
		paintutils.drawLine(w, 1, w, h, colors.red)
		paintutils.drawLine(1, 1, 1, h, colors.red)
		paintutils.drawLine(1, 1, 1, h, colors.red)
		paintutils.drawLine(2, 1, 2, h, colors.red)
		paintutils.drawLine(3, 1, 3, h, colors.red)
		paintutils.drawLine(4, 1, 4, h, colors.red)
		paintutils.drawLine(5, 1, 5, h, colors.red)
		paintutils.drawLine(6, 1, 6, h, colors.red)
		paintutils.drawLine(7, 1, 7, h, colors.red)
		paintutils.drawLine(8, 1, 8, h, colors.red)
		paintutils.drawLine(9, 1, 9, h, colors.red)
		paintutils.drawLine(10, 1, 10, h, colors.red)
		paintutils.drawLine(11, 1, 11, h, colors.red)
		term.setBackgroundColor(colors.lime)
		term.setTextColor(colors.black)
		term.setCursorPos(5, h-4)
		print(" Exit ")
	end
	function spawnGem()
		if spawnedGems >= maxGem then
			playGame()
		else
			paintutils.drawPixel(newX, newY, color)
			spawnedGems = spawnedGems + 1
			gem()
		end
	end




	function gem()
		while true do
			newX = math.random(minX, maxX)
			newY = math.random(minY, maxY)
			colorNum = math.random(1,4)
			if colorNum == 1 then
				color = colors.orange
				spawnGem()
			elseif colorNum == 2 then
				color = colors.yellow
				spawnGem()
			elseif colorNum == 3 then
				color = colors.lime
				spawnGem()
			elseif colorNum == 4 then
				color = colors.lightBlue
				spawnGem()
			end
		end
	end
	frame()
	gem()
end

function frame2()
	slc = 0
	term.setBackgroundColor(colors.white)
	term.clear()
	term.setCursorPos(math.floor(w-string.len("Logged in as: "..playerName))/2, 2)
	print("Logged in as: "..playerName )
	paintutils.drawPixel(1, 4, 32)
	paintutils.drawPixel(1, 6, 8)
	paintutils.drawPixel(1, 8, 16)
	paintutils.drawPixel(1, 10, 2)
	term.setBackgroundColor(1)
	term.setCursorPos(3, 4)
	print(limeName ..limeGems)
	term.setCursorPos(3, 6)
	print(lblueName ..lblueGems)
	term.setCursorPos(3, 8)
	print(yellowName ..yellowGems)
	term.setCursorPos(3, 10)
	print(orangeName ..orangeGems)
	term.setBackgroundColor(32)
	term.setCursorPos(10, 15)
	print("Play")
	term.setCursorPos(20, 15)
	print("Sell Gems")
end

function game()
	term.clear()
	term.setBackgroundColor(1)
	term.setTextColor(32768)
	term.clear()
	term.setCursorPos(math.floor(w-string.len("Name: "))/2, 2)
	write("Name: ")
	playerName = read()
	if playerName == "" then
		game()
	else
		frame2()
	end
end

-- End Functions --

game()

-- User Interaction --

while true do
	event, key, x, y = os.pullEvent()
	if event == "mouse_click" then
		if slc == 0 then
			if  x >= 10 and x <= 18 and y == 15 and key == 1 then
				playGame()
			elseif x >= 20 and x <= 30 and y == 15 and key == 1 then
				sellGems()
			elseif slc == 1 then
				if x >= 5 and x <= 10 and y == h-4 and key == 1 then
					slc = 0
					frame2()
				end
			end
		end
	end					
end

Also when you dont understand the logic of your own game… Still dont get why …then you really should start smaller and train up until you can program such things.

Thanks for re-indenting my code :)/>

And I'm experimenting with tables now to learn :D/>
1lann #22
Posted 08 May 2013 - 07:45 AM
Hey er, I kinda went ahead and made a working example for you to use since I was bored and was in a good mood and whatever. I didn't do exactly what you wanted but that's for you to do ;-). But I made this for you to (and others) to learn from, since I tried to comment it all with explanations and everything.
Commented version: http://pastebin.com/TfziQzmF
Un-commented version: http://pastebin.com/48NYKWe8
Mackan90096 #23
Posted 08 May 2013 - 09:56 AM
Thanks 1lann