Posted 26 October 2013 - 06:37 PM
Hello, I have a question but not the mind to solve it…
The question sorta evolves around my OS.
So to get things straight;
I have a folder in the computer folder called Programs
I have a click-able Programs menu
Menu (Extracted from my OS, Desktop; Cleaned)
Now if I were to put say, program3 into programs; how could I get it to print Program3 after Program2 and make another if X> … and shell.run("programs/program3")
and then rename Program3 to hello it would do the same there, the print becomes hello and the if does shell.run("programs/hello"). And if I deleted programs/hello it would
disappear from the print and if.
So I think the finished code, after I do what I just said will look like this;
Also, where I said what I want it to do, I said "and the if does ..", could I also say "and the if carries..", does it mean the same thing or do does and carries mean different things?
The question sorta evolves around my OS.
So to get things straight;
I have a folder in the computer folder called Programs
I have a click-able Programs menu
Menu (Extracted from my OS, Desktop; Cleaned)
print("Program1")
print("Program2")
dmg = 0
while true do
local event, button, X, Y = os.pullEventRaw()
if dmg == 0 then
if event == "mouse_click" then
if X >=x and X <=x and Y==y and button ==1 --Program 1,
shell.run("programs/program1")
elseif X >=x and X <=x and Y==y and button ==1 --Program 2,
shell.run("programs/program2")
end
end
end
end
Now if I were to put say, program3 into programs; how could I get it to print Program3 after Program2 and make another if X> … and shell.run("programs/program3")
and then rename Program3 to hello it would do the same there, the print becomes hello and the if does shell.run("programs/hello"). And if I deleted programs/hello it would
disappear from the print and if.
So I think the finished code, after I do what I just said will look like this;
print("Program1")
print("Program2")
print("hello")
dmg = 0
while true do
local event, button, X, Y = os.pullEventRaw()
if dmg == 0 then
if event == "mouse_click" then
if X >=x and X <=x and Y==y and button ==1 --Program 1,
shell.run("programs/program1")
elseif X >=x and X <=x and Y==y and button ==1 --Program 2,
shell.run("programs/program2")
elseif X >=x and X <=x and Y==y and button ==1 --hello,
shell.run("programs/hello")
end
end
end
end
Also, where I said what I want it to do, I said "and the if does ..", could I also say "and the if carries..", does it mean the same thing or do does and carries mean different things?