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

How do I track multiple values ​​of X ?

Started by raxteeze, 07 June 2015 - 06:37 AM
raxteeze #1
Posted 07 June 2015 - 08:37 AM
Please, help
Edited on 07 June 2015 - 09:11 AM
raxteeze #2
Posted 07 June 2015 - 09:26 AM
I wrote the code:

function selectlogin()
while true do
local event, button, xPos, yPos = os.pullEvent("mouse_click")
if xPos == 15 and yPos == 10 then
break
end
end
end

paintutils.drawLine(1, 1, 51, 1, colors.red)
paintutils.drawLine(1, 1, 1, 19, colors.red)
paintutils.drawLine(1, 19, 51, 19, colors.red)
paintutils.drawLine(51, 19, 51, 1, colors.red)

paintutils.drawLine(15, 10, 19, 10, colors.red)
term.setCursorPos(15,10)
term.write("Auth")

selectlogin()


We need to track multiple event in the X position.
theoriginalbit #3
Posted 07 June 2015 - 10:49 AM
Topics merged. Please stick to a single topic for issues with the same code.
Edited on 07 June 2015 - 08:49 AM
raxteeze #4
Posted 07 June 2015 - 11:10 AM
Topics merged. Please stick to a single topic for issues with the same code.

Sorry, I thought not added any news.
Bomb Bloke #5
Posted 07 June 2015 - 11:25 AM
You aren't providing enough information to be sure, but it sounds like you want:

if xPos > 14 and xPos < 20 and yPos == 10 then
Edited on 07 June 2015 - 09:26 AM
raxteeze #6
Posted 07 June 2015 - 11:27 AM
You aren't providing enough information to be sure, but it sounds like you want:

if xPos > 14 and xPos < 20 and yPos == 10 then

Ok. Thanks. I try it.
TheOddByte #7
Posted 07 June 2015 - 12:01 PM
For the future when you post code, please use code tags
[code]
– code would be here

This would look like this

-- code would be here
In this case it was not that bad because the code wasn't that long, but it still helps for readability.
Edited on 07 June 2015 - 10:15 AM