Jump to content


uh20's Content

There have been 11 items by uh20 (Search limited from 30-March 23)


By content type

See this member's

Sort by                Order  

#153854 Good Ol Bios 337 Is Throwing A Untraceable Error, Peripherals

Posted by uh20 on 24 November 2013 - 03:00 AM in Ask a Pro

i absolutely hate it when i get this:
bios:337: [string "airdrop"]:81: '=' expected

my first thoughts was i was passing bad arguments to the script, because text needs to be serialized and unserialized back out, but after testing with raw values, i still get the same error. i even noted getting a different error when giving it wrong values

the thing as a whole is supposed do emergency airdrops on a peripheral glasses user who specifies coords for the drop.
some values are only half in use.

line 81 is the first v=v+1 in startMission(), obviously nothing around there is broken/needing = signs

*plop*
x, y, mode = {...}
rednet.open("right")
--0 is south (3 is sunrise)
print("starting")
face = 0
startPos = {-120,224}
--startHeight is the height of the block its on
startHeight = 63
travelHeight = 128
function calculateTurn(direction)
--the wierd calculation magic and i ran out of ideas for value names
pi = direction - face
--determine two lefts or a 180
if math.abs(pi) == 2 then
  turtle.turnLeft()
  turtle.turnLeft()
  face = face+2
  --determine right turn
  elseif pi == -3 or pi==1 then
  turtle.turnRight()
  face = face+1
  --determine left turn
  elseif pi == -1 or pi==1 then
  turtle.turnLeft()
  face = face+3
end
if face > 3 then
face = face - 4
end
function HudNotice()
message = {}
message[1] = "note"
message[2] = ("beginning airdrop on: " .. x .. " " .. z)
rednet.send(0,textutils.serialize(message))
function greenlight()
fuelInBlocks = turtle.getFuelLevel() + (96*turtle.getItemCount(1))
if (fuelInBlocks - totalDistance)<0 then
  error = {}
  error[1] = "urgent"
  error[2] = "Airdrop Delayed! Out of Fuel"
  rednet.send(0,textutils.serialize(error))
  os.reboot()
end
--check items?
--and we are good to go
end
function determinePath()
--find some directions
if startPos[1]>x then
  firstturn = 3
  elseif startPos[1]>x then
  firstturn = 1
  elseif startPos[1]==x then
  firstturn = face
end
if startPos[2]>z then
  secondturn = 0
  elseif startPos[2]<z then
  secondturn = 2
  elseif startPos[2]==z then
  secondturn = face
end
--distance is in absolute value
distanceX = math.abs(math.abs(x)-math.abs(startPos[1]))
distanceZ = math.abs(math.abs(z)-math.abs(startPos[2]))
totalDistance = distanceX + distanceZ
end
--embedding funtions start here
function startMission()
HudNotice()
determinePath()
greenlight()
--lets head up
distance = 128-startHeight
v = 0
while v<distance do
  turtle.up
  v=v+1
end
--first turn
calculateTurn(firstturn)
--go along x
v = 0
while v<distanceX do
  turtle.forward()
  v = v+1
end
--second turn
calculateTurn(secondturn)
--go along z
v = 0
while v<distanceZ do
  turtle.forward()
  v = v+1
end
--go down
height = 128
while turtle.detectDown == false do
  turtle.down()
  height = height-1
end
--drop some stuff
v = 2
while v<17 do
  turtle.select(v)
  turtle.drop()
end
--wait if told to wait
if mode ~= "leave" then
  print("press enter to let me fly home :D/>/>/>")
  read("*")
end
--go back the freaking up
distance = 128 - height
v=0
while v<distance do
  turtle.up()
  v=v+1
end
--go along z axis
turtle.turnLeft()
turtle.turnLeft()
face = face+2
if face>3 then
  face = face-4
end
v=0
while v<distanceZ do
  turtle.forward()
  v=v+1
end
--turn to x axis
turn = firstturn+2
if turn>3 then
  turn = turn-4
end
caclulateTurn(turn)
--go along x axis
v=0
while v<distanceX do
  turtle.forward()
  v=v+1
end
--go down
distance = 128 - startHeight
v=0
while v<distance and turtle.detectDown()==false do
  turtle.down()
  v=v+1
end
--turn and finish
calculateDistance(0)
end
startMission()



#84401 adding in universal server programs: extracting causes problems.

Posted by uh20 on 06 February 2013 - 12:17 PM in Ask a Pro

YES! figured it out

for some reason, you had to rename the extracted folder ComputerCraft with nothing else, despite the fact that the zipped/jar'd form could have 1.481 stuck to the end.

i have no idea why this happens, but maybe the mod loaders (forge) that manage all the mods in tekkit are looking for a specific name/protocall

either way, thanks for the 3rd piece of help this week, im almost dont with my "travelling chest room" im working on which basically combines railcraft and computercraft to let locations "borrow" chest contents from the main chest room over.



#84234 adding in universal server programs: extracting causes problems.

Posted by uh20 on 06 February 2013 - 03:24 AM in Ask a Pro

 TheOriginalBIT, on 05 February 2013 - 06:20 PM, said:

yeh its as a jar in the Tekkit version. deleting meta-inf might fix it.
the CC file does not come with a meta-inf, which one are you talking about.

i get the idea that ark (what im using for extracting/compressing) is doing something, seems ok because the files are extracting ok, but....
is there a location to download computercraft without .zip, the 2 download locations forcibly zip the file up before its sent out



#84147 [Lua] [Question] How to use the AND operator in Lua?

Posted by uh20 on 05 February 2013 - 06:10 PM in Ask a Pro

it is also useful to use bit.band( number, number) to get the name of the number(s) that passed the test in the same run.
http://computercraft...ki/Colors_(API)
dont bother with this method unless your specifically working with colors/cables, the "if ... and ... then" statements is a lot better way of going about this.



#84144 adding in universal server programs: extracting causes problems.

Posted by uh20 on 05 February 2013 - 05:55 PM in Ask a Pro

im trying to add some universal programs to my server since im now becoming too lazy to constantly transfer over disks, however im encountering some troubles.

computercraft seems to come in .jar archive, no biggy, i extracted the file, added what i wanted added in, and then re-compressed it back into .jar

however, when i do this, computercraft computers can no longer find their lua/rom files

i also tried to dry-insert the file into the archive, ran it un-extracted, and also in zip/tar.gz archives with the same results.

btw, im running 1.481 through tekkit lite.
please someone tell me how these files are being compressed.



#82622 Help with Bundled cable & multiple spawners

Posted by uh20 on 01 February 2013 - 11:47 AM in Ask a Pro

oh sorry orwell, mornings and the brain was not up to remembering to look through all the posts. my bad
(no i was not trying to edit yours or something)



#82476 Help with Bundled cable & multiple spawners

Posted by uh20 on 01 February 2013 - 04:05 AM in Ask a Pro

first off, set some definitions to make your life easier
cow = colors.green
pig = colors.black
etc.

next, we need to do some tests and an active monitor activity


Quote

monitor = peripheral.wrap("top")
function monitor()
monitor.clear()
monitor.setTextColor(colors.white)
monitor.setCursorPos(1,1)
monitor.write("Cow Farm:")
monitor.CursorPos(20, 1)

if not cowenabled then
monitor.setTextColor(colors.red)
monitor.write("Inactive")
else
monitor.setTextColor(colors.green)
monitor.write("Active")

end

and so on so forth.

instead of


Quote

redstone.setBundledOutput("back", colors.blue)
sleep(5)
redstone.setBundledOutput("back", 0)
use what orwell suggested
wait(5)

use colors.combine and colors.subtract as shown by orwell to combine the colors in with whats already on with the color you want to enable, then just remove the color you enabled with subtract when the value is passed to rs.setBundledOutput

sorry i cant help more completely, i dont have any more time.



#82464 reading pieces of/splitting a string

Posted by uh20 on 01 February 2013 - 03:10 AM in Ask a Pro

ok, thats what i got mixed up them ;)
was needing this for reading a reboot-file, so the computer can tell what storage carts where after turning off.



#82458 reading pieces of/splitting a string

Posted by uh20 on 01 February 2013 - 03:00 AM in Ask a Pro

OK
i thought string.sub only did substitutions, guess it can also read specific parts of a line as well



#81719 reading pieces of/splitting a string

Posted by uh20 on 30 January 2013 - 03:02 AM in Ask a Pro

hey, ive been having troubles splitting a line from file:read() into pieces (basically i want to know how to edit a string)

for example, how would you split this
line = "12345678"
value[1] = "12"
value[2] = "34"
value[3] = "56"
and so on...

this seems like an easy thing to do, but the search engines have dubiously failed to return any answers.
thanks in advance.



#81293 Get items from chest?

Posted by uh20 on 28 January 2013 - 06:10 PM in Ask a Pro

hello, because i have 3 factories spread apart, i am creating a chest system in combination with Tekkit lite in which you can send out minecarts with a certain catagory of chest contents from a depot.

do be warned that there is no fast way of bringing items about (my tests from depot to my closest factory about 50 blocks away takes a bit more than a minute, the filling of the cart alone takes about 30 seconds.

my own sorting system is close to being internally done, but i have not started on the touchscreen selection or the failsafes for when you order too many carts, if a cart can collide, when the computer reboots, etc.