This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Outdated! New Version Available!
Started by account.username, 04 May 2014 - 08:45 AMPosted 04 May 2014 - 07:56 PM
Please post the code, or I will have to lock your topic. Thanks.
Posted 04 May 2014 - 11:09 PM
Oops. I just forgot to put it in the post. Sorry!
Posted 14 May 2014 - 05:20 AM
Lua comments use two hyphens. Keep the hashes though, as the forum software doesn't recognize Lua comments.
--# Valid Lua comment that the forum will highlight correctly.
Posted 14 May 2014 - 01:53 PM
in your button code you have this
button.dispName = “Cool button” #Whether or not it will display the percent above the button
might i suggest
button.dispName = “Cool button” #What label it will display on the button
Edited on 14 May 2014 - 11:53 AM
Posted 14 May 2014 - 04:57 PM
@elcid534 that is a mistake in my code example. That is what that code does. Sorry!
Posted 14 May 2014 - 06:06 PM
Suggestion: Text Boxes
The player can type in them and the text that was typed in can be used for something like a print() or if the input matches something it triggers something
Also:Can the progress bar do something when it ends?
Can buttons do something when clicked?
And if they can, how do I make that
Another Suggestion: Progress bar progress. So It actually is a progress bar.
The player can type in them and the text that was typed in can be used for something like a print() or if the input matches something it triggers something
Also:
Can buttons do something when clicked?
And if they can, how do I make that
Another Suggestion: Progress bar progress. So It actually is a progress bar.
Edited on 14 May 2014 - 04:30 PM
Posted 14 May 2014 - 11:21 PM
@win7yes I don't understand what you are asking for with the progress bars. Also the buttons can be triggered when clicked. Here's some example code:
Also thank you for the text box idea. I will work on that!
event,mouseClick,x,y = os.pullEvent("mouse_click")
buttonName = gui.checkButtons(x,y)
if buttonName == "but" then
functionThatDoesSomething()
end
Also thank you for the text box idea. I will work on that!
Posted 15 May 2014 - 02:24 AM
With the progress bar I mean that it moves instead of being in one single position. Like any second it goes up one pixel. (Like a real Progress bar) Or is that already possible? I have been trying to do some random things to make it do that but it wasnt working.
Posted 16 May 2014 - 02:50 AM
@win7yes Try this and see if this is what you mean:
That's not actually the progress of something but that's an example of how to make it increase.
while true do
sleep(1)
bar.percent = bar.percent + 1
end
That's not actually the progress of something but that's an example of how to make it increase.
Posted 16 May 2014 - 04:00 AM
I tried that and it just got the program stuck or sending an error. Anyway I will try again
EDIT: That didnt work. I got the next thing: gui:43: bad argument: number expected, got nil
Nevermind, I got it working by adding some sort of redraw thing :)/>
Another Edit: I tried the button thing but it just says bios:366: [string "infoapp"]:25:expected "="
EDIT: That didnt work. I got the next thing: gui:43: bad argument: number expected, got nil
Nevermind, I got it working by adding some sort of redraw thing :)/>
Another Edit: I tried the button thing but it just says bios:366: [string "infoapp"]:25:expected "="
Edited on 16 May 2014 - 03:12 AM
Posted 17 May 2014 - 08:01 AM
@win7yes These must be errors on your part. I have used this api a lot and have never got it to error.