Jump to content


OReezy's Content

There have been 91 items by OReezy (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#193313 Touch Screen openblocks Radio Controller v1.1.2

Posted by OReezy on 11 September 2014 - 01:41 AM in Programs

View PostBalverine, on 27 August 2014 - 04:47 PM, said:

No matter which setup I use, it always tells me the peripherals are not found.

View PostKizz, on 27 August 2014 - 05:30 PM, said:

Yea same here. Just released my own little jukebox. Didn't know it was possible to even check the playing music.

I know its been awhile, but if either of you see this which peripheral is not found? Do you get a message telling you or is it a crash?

Also, fixed a bug when connecting with network cables.



#180755 Touch Screen openblocks Radio Controller v1.1.2

Posted by OReezy on 26 May 2014 - 10:33 PM in Programs

Does anyone think it would be better to have the radio turn off if you click the disk that is already playing?

v1.1.1
  • Added -v<1-15> argument for setting initial volume
  • Radio now remembers custom settings when you start with arguments
  • "OFF" button now changes to "ON" when music is playing
  • Fixed a bug that caused radio to not turn on initially and after pushing "OFF"



#175675 Touch Screen openblocks Radio Controller v1.1.2

Posted by OReezy on 28 April 2014 - 04:06 PM in Programs

View Postpunchin, on 19 April 2014 - 11:20 PM, said:

-snip-

Sorry it took so long for a response. I am planning on having the program be able to save default settings. That way if you have it running on a computer with lots of other monitors and things, you won't need to enter a list of arguments every time. I will include a default volume for this too.

The way the "OFF" button works at the moment removes the disk from the radio. It shouldn't be too difficult to have it work like a real power button though. As for the power symbol, "(|)" is the best I can think of. School is ending this week so I'll try to get these updates going once everything is done.



#175003 Altering Tables

Posted by OReezy on 23 April 2014 - 06:30 PM in Ask a Pro

Simply assign it value.
local table = {"one", "two", "three"}
print(table[2]) --> two
table[2] = "not two"
print(table[2]) --> not two

edit: Was typing this up as you edited your post. Yes, that works.



#174985 Grabbing Arguments

Posted by OReezy on 23 April 2014 - 04:25 PM in Ask a Pro

Check out the string library.
http://lua-users.org...LibraryTutorial

Once you have your string you can use functions like string.match() to search for words or patterns.



#174601 Trouble Loading Monitor on Startup

Posted by OReezy on 21 April 2014 - 12:18 AM in Ask a Pro

This is the problem here:
local mX, mY = monitor.getSize()
monitor.setTextScale(3)
The size is based on the scale so when you increase the scale to 3, the values you saved for size before changing the text scale are incorrect from then on.This means its likely printing off screen. When you restart the program without rebooting, the text scale is still 3 so it gets the correct size the second time around. Switching those two lines of code should fix your problem.



#172855 [Fixed]isAdmin not working correctly

Posted by OReezy on 11 April 2014 - 03:11 PM in Ask a Pro

Without indentation its hard to follow your code but I did look at your loadFile() and two things stand out to me:
local data = file:read()
Looking at the wiki, the read() function is only usable in binary read mode ("rb"). For the normal read mode ("r"), you have readLine() and readAll() Although I'm pretty sure it would give you an attempt to call nil error if this was the case. Have you tried printing the variable to verify its getting the value you think its getting?

Also, textutils.unserialize() is used for tables. If your file doesn't contain a table that could be an issue too.

Edit: Looked again at the isAdmin() and the second thing shouldn't be an issue.



#170946 Turtle Controlled Mob Spawner

Posted by OReezy on 01 April 2014 - 12:34 AM in Turtle Programs

View PostAnkouAquilis, on 29 March 2014 - 12:31 AM, said:

Amazing... Would be nice if you could add a touch screen compatibility. Other than it its great :)

I'm actually looking at rewriting this program. I should have a new program out soon that will support touch screens.



#169640 Some help with peripheral functions in cc

Posted by OReezy on 25 March 2014 - 01:46 AM in Ask a Pro

The pull and push functions return the number of how many items were moved. When it says 0 its pretty much saying it failed to move anything. Now the reason it failed is because inventories need to be adjacent to each other. The chest needs to be touching the reactor.

You will need to wrap either the reactor or the chest with a wired modem. If you choose the chest use the peripheral proxy block to connect the modem to the chest.



#169612 Red Stone In Motion & Computer Craft Elevator Program Help ?

Posted by OReezy on 24 March 2014 - 09:44 PM in Ask a Pro

I don't have any experience with Redstone in Motion, but from watching that video I think a basic elevator it would work something like this:

1. Setup your computer/motor at the base
2. Setup a monitor on each floor

a. Each monitor needs to be connected with network cable/modems

b. Each monitor would have 2 buttons: up and down

3. When a button is pressed start a for loop that repeats the command to move up or down

A basic for loop looks like this
for i = 1, 10 do
  --do stuff
end

More info on loops

To detect button presses you need to use events

Hope this helps.

EDIT: If it works the same way as the old redpower frames, I would try having a long pillar of frames below the actual platform that pulls/pushes it up and down. It really depends on how tall your elevator is, if this will work or not.



#169597 [Whack a Pig][AlphanumericAPI]

Posted by OReezy on 24 March 2014 - 08:46 PM in Games

Found some bugs for you.

Line 219:
download("http://pastebin.com/FcbUaCvM",alphanumeric)
Needs to be
download("http://pastebin.com/raw.php?i=FcbUaCvM","alphanumeric")
1. alphanumeric needed to be a string 2. the url needs to get the raw paste else it gets the code of the website too which messes up the api.

Line 1185:
home = term.current()
Had to comment this out because it is nil. I'm using ComputerCraft v1.57.

Overall it is a pretty fun game. I do have a couple suggestions though. For speed mode you could have a point multiplier at certain amount of hits without any misclicks or letting a pig sneak by. And for endurance mode have "lives" that you lose if you misclick or let a pig sneak by instead of it just being forever.



#169112 Touch Screen openblocks Radio Controller v1.1.2

Posted by OReezy on 21 March 2014 - 07:30 PM in Programs

View PostDoom6197, on 21 March 2014 - 04:00 PM, said:

Thanks for this, really makes life easier.

I'm happy I could help.

View PostBallistic Buddha, on 21 March 2014 - 10:40 AM, said:

Hah, wow. I actually just made myself a program for radio control, I knew I should have checked the forums first :P.

I always encourage people to try to do things themselves too. I love to see how different people handle the same issues.

View PostBallistic Buddha, on 21 March 2014 - 10:40 AM, said:

Now, Since I'm still a fan of the big ass vertical monitor for volume control, I feel inclined to merge my code with yours. I took a quick peek at your code and it looks pretty neat and organized, so it shouldn't be all that hard to do.

Feel free to pick apart my code. If you have any questions about how the code works, I would be more than happy to answer them.

Off Topic: Your base setup in that picture looks awesome.



#169029 Rednet Cable and AnalogOutput

Posted by OReezy on 20 March 2014 - 10:51 PM in Ask a Pro

Rednet will carry the same signal it receives so if you put a piece if Redstone between your computer and the cable, analog will work up to a strength of 14. You won't be able to use the different color channels however.



#169025 os.pullEvent for multiple, specific events

Posted by OReezy on 20 March 2014 - 10:26 PM in Ask a Pro

View PostImred Gemu, on 20 March 2014 - 04:18 PM, said:

You could also do something like this:
os.pullEventWhitelist = function(...)
local tArgs = {...}
while true do
  tEvent = {os.pullEvent()}
  if #tArgs < 1 then
   return unpack(tEvent)
  end
  for k, v in ipairs(tArgs) do
   if tEvent[1] == tostring(v)then
    return unpack(tEvent)
   end
  end
end
end
then call that like:
local event, par1, par2, par3 = os.pullEventWhitelist("key", "char")

Isn't this a bit redundant? Wouldn't you still have to check which type of event it was?



#168618 Touch Screen openblocks Radio Controller v1.1.2

Posted by OReezy on 18 March 2014 - 01:02 AM in Programs

View PostFenric, on 16 March 2014 - 10:32 PM, said:

It's working great now, thanks a lot for posting this.

I'm glad you like it.

Udate: 1.1.0
  • Advanced Terminal support
  • Can specify which monitor to use
  • Now runs in background
  • Accepts arguments
Arguments:
  • -t Terminal mode
  • -nd Non-Daemon mode
  • -d Debug mode
  • -m<side or name> Specify a monitor to use
  • -s<.5-5> Sets scale of monitor (not available for terminal)



#168206 Custom shell on floppy disk

Posted by OReezy on 15 March 2014 - 01:24 PM in Ask a Pro

You want to run a program from your cmd program like the shell right?

To do that you would need to get an input with read () then use the string.match to separate the parts.



#167927 ThermalExpansion Clock

Posted by OReezy on 13 March 2014 - 03:55 AM in Ask a Pro

First you would need an order for your turtles, and it would look something like this
Spoiler
So for each digit, you would index the turtle IDs in a table in that order. Next you would use it to determine which turtles you needed to make a number. So for the number seven you would need: 1, 2, 3, 5, 7, 9, 14, 16, 18.
local digits = {} --Holds the tables for the digits
digits[1] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18} --All the turtle IDs in the first digit
local numbers = {}
numbers[7] = {1, 2, 3, 5, 7, 9, 14, 16, 18} --The turtle locations needed to make the number seven
Now use a loop to use the numbers in your "numbers" table to send a message to the necessary turtles in your "digits" table
for i = 1, #numbers[7] do
  rednet.send(digits[1][numbers[7][i]], "message") --Sends a message to all the turtles in the first digit whose location matches that of the numbers in your table for seven
end
Then you have some code on the turtles that tells it to change colors when it receives a certain message.

This is all untested and there may be better ways to do it but this is what I thought of to use turtles.



#167892 Touch Screen openblocks Radio Controller v1.1.2

Posted by OReezy on 12 March 2014 - 08:18 PM in Programs

View Postwillwac (NewCoolPC), on 12 March 2014 - 02:31 PM, said:

View PostOReezy, on 10 March 2014 - 02:57 AM, said:

And whats a debian?
Sorry, I ment daemon.
Basiclly, run it on the monitor, yet allow users to use the shell.
Also, I had a few ideas.
Spoiler

I really like this idea. Going to have to look into daemons. I am already planning to make a terminal version as well.



#167891 Controlling Resonant Energy Cells

Posted by OReezy on 12 March 2014 - 08:07 PM in Ask a Pro

That sounds correct. For any peripheral that you connect a wired modem to, you use the name it displays when you turn the modem on.



#167889 ThermalExpansion Clock

Posted by OReezy on 12 March 2014 - 08:03 PM in Ask a Pro

This is just a thought but I would try making two tables. One table would contain the IDs of all the turtles in each digit in the same order for each table. The second table would be for tables that hold locations numbers themselves. So whichever slot needs to be lit up would get a rednet message.

So if you need to display a seven, you would use the numbers in the table holding the locations for the number seven, and send it to turtles in the table for which digit you want to display it in.

I imagine this sounds kind of weird, so if its hard to understand what I'm trying to say let me know and I will make a picture.



#167885 Controlling Resonant Energy Cells

Posted by OReezy on 12 March 2014 - 07:35 PM in Ask a Pro

What I prefer to do when collecting information from multiple sources, is to wrap the peripherals to a index inside a table. Normally when you wrap a peripheral it looks something like this:
local var = peripheral.wrap("side")
You can do the same thing with a table.
local table = {}
table[1] = peripheral.wrap("side")
This does the exact same thing as before, but instead of saving the wrapped peripheral inside the variable named "var" you are saving it to an index in a table. If you want to call a method for a peripheral wrapped this way, you simply write it the same way but use the table index instead.

Note: If you are using wired modems and network cable, instead of a side you want to use the name of the peripheral. The name you need to use will be displayed in your chatbox in Minecraft when you enable the modem connected to the peripheral.

table[1].method()
You can also use keys if you prefer, but I feel indexes are easier to code for. Now that we have our table of peripherals, you can use a loop to iterate through them all.
for i = 1, #table do
  table[i].method()
end



#167790 Controlling Resonant Energy Cells

Posted by OReezy on 11 March 2014 - 08:12 PM in Ask a Pro

To see what methods a peripheral has, you can use this script.

for k,v in pairs(peripheral.getMethods("side") do
  print(v)
end

Off the top of my head I think the method that gets energy is getStoredEnergy()

Also, I don't remember if you can throttle the input and output but you can turn output off by supplying a Redstone signal if your cells are set up for it.



#167715 Touch Screen openblocks Radio Controller v1.1.2

Posted by OReezy on 10 March 2014 - 07:25 PM in Programs

Update: v1.0.1
  • Added an additional check for wrong disk type
  • Updated initialEmpty() to find the first open slot in a chest instead of attempting all slots until it comes across an empty slot
  • Removed unnecessary function getRadioDisk()



#167655 Controling A Base

Posted by OReezy on 10 March 2014 - 04:43 AM in Ask a Pro

ModemAPI

You wrap the modem as a peripheral and use open(channel) to listen on a channel, and transmit(channel, replyChannel, message) to send messages on that channel.

local modem = peripheral.wrap("side")
modem.open(12) --opens channel 12
modem.transmit(20, 5, "hello") -- sends on channel 20, with a reply channel 5, and the message 'hello'

To catch messages you use os.pullEvent() which gives you:
  • event type (modem_message)
  • side your modem is on
  • channel
  • reply channel
  • message
  • distance



#167651 Touch Screen openblocks Radio Controller v1.1.2

Posted by OReezy on 10 March 2014 - 02:57 AM in Programs

View PostDog, on 09 March 2014 - 05:39 PM, said:

Got it working - was using the wrong 'disks' (facepalm)

I was thinking about asking this but it felt silly, sorry :P

View Postwillwac (NewCoolPC), on 10 March 2014 - 12:19 AM, said:

This is great! I recomend changing the color of the scroll buttons and changing the "OFF" button to "QUIT" or "EXIT" when nothing is playing.
Or how about a debian?

Thanks. I am thinking of adding an options menu for changing all the colors. I don't know if I will make the "OFF" button change to "EXIT" because it seems like it could be clicked on accident on small monitor setups pretty easily. If I do make an options menu though, I will probly add it as an option to turn that on.

And whats a debian?