Jump to content




help with counter


  • You cannot reply to this topic
3 replies to this topic

#1 korupt_virus

  • New Members
  • 6 posts

Posted 12 April 2012 - 04:17 AM

http://pastebin.com/DFaTnew1 keeps throwing bad argument: string expected got nil. Please help with this as this is a great part of my base.

#2 virtualayu

  • New Members
  • 31 posts

Posted 12 April 2012 - 06:44 AM

first :

redstone.setBundledOutput("back", colors.white,true)
sleep(.5)
redstone.setBundledOutput("back", colors.white,false)

this is not how bundled cables works...
try :

rs.setBundledOutput("back", colors.white)
sleep(.5)
rs.setBundledOutput("back", rs.getBundledInput("back") - colors.white,) -- this is how set off a bundled cable...

you can't say true or false... it's not that simple^^
and use rs.set or rs.get is simple than redstone.set ....

in your first line why did you wrote uum = "uum" ??? no need... you say uum = 0 if the file don't exist and say uum = tonumber(count.readline()) if it does... so why did you declare it in the first place?? (thats not a big deal but is 100% useless)

in order to be clear please in an "if" write the variables in the right order... "if i == uum then" not "if uum == i then" (again not a big deal it don't change the program but it's easyer to read ^^)



I assume that your program is called "get", am i right?
don't end your program by calling it again... just make a loop ^^
after getting values in your file and closed it, put this : while true do
and at the end put an end to close the loop

so the correct code for all of this should be :
Spoiler


#3 Luanub

    Lua Nub

  • Members
  • 1,135 posts
  • LocationPortland OR

Posted 12 April 2012 - 06:49 AM

View Postvirtualayu, on 12 April 2012 - 06:44 AM, said:

first :

redstone.setBundledOutput("back", colors.white,true)
sleep(.5)
redstone.setBundledOutput("back", colors.white,false)

this is not how bundled cables works...
try :

rs.setBundledOutput("back", colors.white)
sleep(.5)
rs.setBundledOutput("back", rs.getBundledInput("back") - colors.white,) -- this is how set off a bundled cable...

you can't say true or false... it's not that simple^^
and use rs.set or rs.get is simple than redstone.set ....

in your first line why did you wrote uum = "uum" ??? no need... you say uum = 0 if the file don't exist and say uum = tonumber(count.readline()) if it does... so why did you declare it in the first place?? (thats not a big deal but is 100% useless)

in order to be clear please in an "if" write the variables in the right order... "if i == uum then" not "if uum == i then" (again not a big deal it don't change the program but it's easyer to read ^^)



I assume that your program is called "get", am i right?
don't end your program by calling it again... just make a loop ^^
after getting values in your file and closed it, put this : while true do
and at the end put an end to close the loop

so the correct code for all of this should be :
Spoiler

The real way/best way to work bundled cables is...

to turn on - turns on white
c = colors.combine( c, colors.white )
rs.setBundledOutput("back", c )

to add more - combined with the above with have white/orange on
c = colors.combine( c, colors.orange )
rs.setBundledOutput("back", c )

and to turn off  - white off/ orange on
c = colors.subtract( c, colors.white )
rs.setBundledOutput("back", c )

type help redpower from a console for more info

Edited by luanub, 12 April 2012 - 07:03 AM.


#4 virtualayu

  • New Members
  • 31 posts

Posted 12 April 2012 - 03:50 PM

yes if you use multiple colors but in this case he use only one color and his program is very simple.
so he don't have to make variables with conbined colors...





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users