Jump to content


xbsktball10x's Content

There have been 24 items by xbsktball10x (Search limited from 10-February 22)


By content type

See this member's

Sort by                Order  

#162282 openccSensor help

Posted by xbsktball10x on 28 January 2014 - 02:27 AM in Ask a Pro

thought it was a sensor turtle.. was wireless... FACEPALM



#162279 openccSensor help

Posted by xbsktball10x on 28 January 2014 - 02:15 AM in Ask a Pro

im using the modpack big dig and im playing on the server... i know its openccsensor bc it has everything in the mod that ocs does



#162277 openccSensor help

Posted by xbsktball10x on 28 January 2014 - 02:09 AM in Ask a Pro

I am trying to create a program on a turtle that will search for applied energistics machines on a multi player map and then mark those cords and return to my base and tell me the cords.... problem is when i do os.loadAPI("ocs/apis/sensor") it tells me that the file is not found



#161665 vertically scrolling text

Posted by xbsktball10x on 23 January 2014 - 02:31 AM in Ask a Pro

That did not work



#161662 vertically scrolling text

Posted by xbsktball10x on 23 January 2014 - 01:12 AM in Ask a Pro

Text = {
"The year was 2025. Aerial drones had revealed a large weapons cache in Siberia.",
" ",
"United Nations investigators were sent to investigate.",
" ",
"Once they got there they were met by Russian military. ",
" ",
"The Russians captured and executed the agents.",
" ",
"What were once thought to be nuclear weapons were soon revealed as anti-matter.",
" ",
"A weapon like no one had ever seen. A global scare prompted a new kind of space race.",
" ",
"A secret task force assembled to begin work on what only science fiction had thought possible before.",
" ",
"They started to build deep space vessels capable of supporting life.",
" ",
"They believed there was a possibility of life on other planets.",
" ",
"As work neared completion of the Icarus; the Russians found out.",
" ",
"Only a portion of the life support was completed when the war began.",
" ",
"Knowing that this would be the end of earth a rash decision was made,",
" ",
"they were going to launch the Icarus and head for the moon.",
" ",
"Only one section of the ship had breathable air,",
" ",
"this is where they setup a station to refill breathable tanks so that people could survive in space.",
" ",
"In the first year of the war Russia had expanded its territory to berlin.",
" ",
"As there was no slowing them down the Icarus was launched.",
" ",
"Upon reaching the moon it had been revealed that in our 55 year absence a new species had inhabited the moon.",
" ",
"The powers of the tesseract were revealed and teleportation finally became a reality.",
" ",
"Several years had passed and thousands of drones later they had found a suitable planet.",
" ",
"With little life support leaders believed the best way of reaching this planet would be",
" ",
"to send small settler groups to the planet and begin colonizing it.",
" ",
"The settlers began to plant trees, grow crops and create breathable oxygen levels.",
" ",
"However, soon it was discovered that this planet had resources like no one had seen",
" ",
"People knew they could profit from this world and began to mine its resources.",
" ",
" Soon factions were forming, and small warfare was beginning to break out across this new planet….",
" ",
" ",
" ",
" ",

"Here we are today; this is the first bunker created by the Terra Nova Army",
" ",
"and serves as the hub for new survivors to get a new start on the world",
" ",
"we know today as INSERT WORLD NAME HERE.",
" ",
"You can buy supplies and view the ranks in the terra nova army.",
" ",
"New world rules will be in the main atrium along with ranks",
" ",
"and items that have been banished from the new world so that it does not have the same fate as earth.",
" ",
"Please view the rules or your fate could very well be decided by the military leaders.",
" ",
"Earth is still habitable however riddled with radiation it is very dangerous.",
" ",
"War still rages there and bombs fall frequently.",
" ",
"Resources are still there however death is almost emanate.",
" ",
"Travel there at your own risk.",
" ",
}
mon = peripheral.wrap("top")
mon.clear()
wScreen, hScreen = mon.getSize()

function Vertical()
for i = -#Text, hScreen do
	  for t = 1,#Text do
		mon.setCursorPos(1,i+t)
		mon.write(Text[t])
print(i+t.." "..i.." "..t)


	  end
   mon.setCursorPos(1,i)
   sleep(.8)
   mon.clear()
  end
end

while true do
Vertical()
end


Hey guys im trying to make the text scroll up. So its like star wars intro text. This code make it scroll downward so it starts from the last line and scrolls down so that the beggining of the paragraph is the last thing shown. I have tried to change the numbers around but cant think of the way to make it go the other way. Can anyone help



#137096 Code not working :(

Posted by xbsktball10x on 30 July 2013 - 08:28 PM in Ask a Pro

rednet.open("top")
local monitor = peripheral.wrap("right")
local new = false
local items = {
["stone  "] = 0,
["brick  "] = 0,
["dirt   "] = 0,
["wodndor"] = 0,
["cobble "] = 0,
}
monitor.clear()
monitor.setCursorPos(1,1)
local function receive()
local _, item= rednet.receive(1)
local _, qty = rednet.receive(1)
  if items[item] then
	new = true
	items[item] = items[item] + qty
  else
  print("unrecognized item: "..tostring(item))
  end
for k,v in pairs(items) do
if new == true then
monitor.clear()
monitor.setCursorPos(1,1)
end
monitor.write(k..":"..v)
local x,y = monitor.getCursorPos()
print(y)
print(x)
x = x - 9
y = y+1
  if y == 28 then
	x = x + 10
	y = 1
  end
monitor.setCursorPos(x,y)
end
end
while true do
receive()
end

Hey guys Im back and everything is seeming to work perfectly. However my issue now is im trying to make a board of monitors that displays how many items I have of each type. I have it set up so that when the turtle receives a new block it sends a signal to this server with the name of the block and then how many it has. it works perfectly but, it will not count correctly if alot are coming in. for example if i get a thing of cobble and a thing of stone at the same time it will be in the procceses of adding to the cobble and will miss the message from the stone turtle. any ideas on how to prevent this?



#132726 banking system help

Posted by xbsktball10x on 10 July 2013 - 10:21 PM in Ask a Pro

Yeah Dman you would have to make a table of all the trusted computer Id's and make it run through the table and if it returns that its in there then allow access



#132052 banking system help

Posted by xbsktball10x on 08 July 2013 - 02:26 AM in Ask a Pro

Dman what do you need to make impossible to hack into? the accounts? or like the gold storage area?



#131606 Code not working :(

Posted by xbsktball10x on 06 July 2013 - 03:18 AM in Ask a Pro

nvm :) but ill give this a try!



#131603 Code not working :(

Posted by xbsktball10x on 06 July 2013 - 02:56 AM in Ask a Pro

View Posttheoriginalbit, on 06 July 2013 - 02:39 AM, said:


local function receive()
  local _, item = rednet.receive()
  local _, qty = rednet.receive()
  if items[item] then --# if the item name sent is in our table
	items[item] = items[item] + qty --# add the quantity to the old total
  else
	print("unrecognised item: "..tostring(item))
  end
end

okay so would i add to the table the same way? also in the lines

local function receive()
  local _, item = rednet.receive()
  local _, qty = rednet.receive()

the "_", is that suppose to senderId, message, distance?

Thank you for all the help ive seriously been at this for days



#131595 Lua Program Pulling a java error!

Posted by xbsktball10x on 06 July 2013 - 02:14 AM in Ask a Pro

I cant find anywhere in the code that would be throwing this. I happens to me if i call a call a function inside of its own function. i did just look it over quickly but maybe look for a function calling itself. The only thing i can see there being a problem would be calling draw() alot inside of all the other functions



#131593 banking system help

Posted by xbsktball10x on 06 July 2013 - 02:03 AM in Ask a Pro

View Postdarkrising, on 04 July 2013 - 04:15 AM, said:

Looking at your code it would probably be easy to have your accounts on a unique index, You could store the index as a number and increase it each time or use table.insert to insert the account array into the next available number.

That way each one of your accounts would be unique and will not clash.

account = {}

function newUser(pin, account)
  local u = {}
  u.pin = pin
  u.account = account
  return u
end

table.insert(account, newUser(2394994, 234))

-- in this example the new user will have an index of 1, so account[1].pin  would be there pin and
-- account[1].account would be their account number


a little new to cc so how exactly would this work?



#131592 Lua Program Pulling a java error!

Posted by xbsktball10x on 06 July 2013 - 02:01 AM in Ask a Pro

while true do
function()
end

this is of course assuming you have a yield in your function otherwise it will throw the "running to long without yielding" exception



#131591 Code not working :(

Posted by xbsktball10x on 06 July 2013 - 01:52 AM in Ask a Pro

Ok so here is a new version of the code and it is working a little bit better,
rednet.open("top")
local blocks ={"brick", "stone"}
local amount = {1,1}
local function receive()
local senderId, message, distance = rednet.receive()
local senderId2, message2, distance2 = rednet.receive()
  for i, v in ipairs(blocks) do
    if message == v then
      print(blocks[i])
      message2 = (tonumber(message2))
      local amounts = amount[i]
      print(amounts)
      amounts = (tonumber(amounts))
      local newamount = (amounts + message2)
      table.remove(amount, amounts)
      table.insert(amount, amounts, newamount)
      print(amount[amounts])
    break
    elseif message ~= v then 
      table.insert(blocks, message)
      print("added".." "..message)
      table.insert(amount, message2)
      print("added".." "..message2)
    break
    end
  end
end

while true do 
receive()
end

So now my problem is that the function runs perfect if you are adding amounts to the bricks. however, if i am trying to add to stone it doesnt add to it. instead it creates a new variable in the table called stone and even when i try to add to this new variable it still creates another. I switched stone and brick around and same results. If im not adding to the first one in the table then it skips to creating a new entry. Any thoughts? my assumption is that if checks the message == v part and doesnt move past the first spot in the table but i dont know why it wouldnt check the other values



#131584 Code not working :(

Posted by xbsktball10x on 06 July 2013 - 01:13 AM in Ask a Pro

Im gonna sort the items using buildcraft pipes so only 1 item or block type will fill into the turtle. Thank you i tried that and now im working out more bugs lol but it helped alot thanks



#131573 Code not working :(

Posted by xbsktball10x on 05 July 2013 - 11:40 PM in Ask a Pro

Sorry guys i havent been on but let me maybe specify a little more. This is the server and i have one computer setup so that i can quickly input all the types of blocks that are in the inventory system. im currently working out the turtle part of this but basically i will sort the incoming blocks and items and put them into there correct turtles. the turtles will constantley check to see if any blocks have but put into it. If blocks have been entered it will count how many blocks it has then put them in a deep storage unit and then it will send a message of what chest it is. ie if its the stone chest it will send a message saying stone then how many it counted to be added. The server will then accept the message and run through the table until it finds the item. once it finds the position of that item. so kind of like a password and username login system it will then store the key that item is in the table at and then in that same position on the amount table it will add the new amount to the old amount and then delete the old amount and then add the new value back into that spot. so in theory it should keep track of how many blocks of each item i have. which i will then use this too put on a huge monitor and display for easy tracking.



#131571 banking system help

Posted by xbsktball10x on 05 July 2013 - 11:25 PM in Ask a Pro

Thank you so much guys this has been a frustrating process. and Team Dman go right ahead and write all you want im still working the bugs out with this one but if you come up with a script like this then please share it with me :D.



#131130 Code not working :(

Posted by xbsktball10x on 03 July 2013 - 11:08 PM in Ask a Pro

rednet.open("top")
local items = {}
local amount = {}
local place = ""
local oldplace = ""
function receive()
local senderId, message, distance = rednet.receive()
local senderId2, message2, distance = rednet.receive()
print("message received")
      for k,v in ipairs(items) do
         if message == v then 
           senderId, message, distance = rednet.receive()
           oldplace = amount[k]
           place = amount[k] + message
           table.remove(amount, oldplace)
           table.insert(amount, oldplace, place)
         elseif message ~= v then
           table.insert(items, message)
           table.insert(amount, message2)
           print("inserted stuff")
     end
     end
     for i = 1,#items do
     print(items[i])
     end
     for i = 1,#amount do
     print(amount[i])
     end
print("function done")
receive()
end
term.clear()
term.setCursorPos(1,1)
receive()
Im trying to set up an inventory system and this code is suppose to check to see if the name of the block is in the table and then if it is it will then take the amount of that block and add the new amount to it then remove the amount from the table and insert the new amount but it wont do that it skips from line 9 to line 29 and idk why



#131093 banking system help

Posted by xbsktball10x on 03 July 2013 - 07:44 PM in Ask a Pro

bump.. really need some help with this



#130517 banking system help

Posted by xbsktball10x on 30 June 2013 - 10:15 PM in Ask a Pro

got it there you go



#130515 Complicated User Data Help

Posted by xbsktball10x on 30 June 2013 - 10:05 PM in Ask a Pro

You could maybe create a variable then set that variable to what they input and then store it into a table

something like

local mytable = {}
local userinput = ""
write("enter stuff: ")
userinput == read()
table.insert(mytable, userinput)



#130512 banking system help

Posted by xbsktball10x on 30 June 2013 - 09:49 PM in Ask a Pro

Im working on a banking system and i just finished up the code to add a new account. My problem is that if someone chooses a pin that is the same as someone else it will return that they also have the same account # as the person that has the same pin as them. heres the code

client
term.clear()
term.setCursorPos(1,1)
rednet.open("left")
local successfullogin = false
print("welcome to the bank")
print("1] login")
print("2] create new account")
print("3] shutdown")
write(">")
local firstoption = read()
  if firstoption == "1" then
	rednet.send(51,"login", true)
	write("account number: ")
	local accountnumb = read()
	write("pin: ")
	local pinnumb = read("*")
	rednet.send(51, accountnumb, true)
	local senderId, message, distance = rednet.receive(5)
	print(message)
	senderId, message, distance = rednet.receive()
	  if pinnumb == message then
		successfullogin=true
	  end
  elseif firstoption == "2" then
	rednet.send(51, "create new account", true)
	write("Enter a 4 digit pin for your account: ")
	local pin = read("*")
	rednet.send(51,pin, true)
	localaccountsenderId, accountnumber, accountdistance = rednet.receive()
	write("Your account number is: "..accountnumber)
  sleep(2)
  elseif firstoption == "3" then
	print("shutting down...")
	sleep(1)
	os.shutdown()
	else
  print("unsuccessful login")
  sleep(1)
  end
function menu()
print("1) withdraw")
print("2) deposit")
print("3) wire tranfer")
print("4) balance inquiry")
print("5) logoff")
write("Enter a number: ")
local option = read()
   if option == "1" then
   print("Enter go back to go back to the menu")
   write("How much? ")
   local amount = read()
	 if amount == "go back" then
	 menu()
	 else
	 rednet.send(51, "withdraw", true)
	 rednet.send(51, amount, true)
	 print("withdrawing funds...")
	 print("gold will be in withdraw area")
	 sleep(1)
	 menu()
   end
   elseif option == "2" then
	 write("Do you want to deposit? y/n")
	 local deposit = read()
	   if deposit == "y" then
		 rednet.send(51,"deposit", true)
		 else
		 menu()
	   end  
   elseif option =="3" then
	 --wire transfer code
   elseif option == "4" then
	 rednet.send(51, "balance", true)
	 local senderidbalance, balancemessage, distancebalance = rednet.receive()
	 print(balancemessage)
   elseif option == "5" then
	 shell.run("startup")
   else
	 print("That isn't a selection")
	 sleep(1)
   end
   sleep(2)
   menu()
  end
if successfulogin == true then
rednet.send(51, "validuser", true)
menu()
else
term.clear()
term.setCursorPos(1,1)
shell.run("startup")
end

server

print("This is the account server")
print("If you need to add an account then please do so through the admin computer in the server rooom")
print("Do not restart ever")
print("If you restart then all of the accounts and pins will be lost")
local pins = ""
local accounts= ""
local accountsId = ""
local realaccount = false
local accountaccess = false
rednet.open("top")
local account = {566001,566002,566003,566004}
local accountId = {46,52,53,54}
local pin = {}
local accountbalance = {0,0,0,0}
function accountlogin() -- sets it so you can acces account functions
local senderId, message, distance = rednet.receive()
if message == "login" then
senderId, message, distance = rednet.receive()
for i,v in ipairs(account) do
  if message == v then
	accountnumb = message
	realaccount = true
	rednet.send(senderId, "accessing your account...", true)
	pins = (pin[i])
	accountsId = (accountID[i])
	rednet.send(senderId, pins, true)
  else
	rednet.send(senderId, "That account doesnt exist", true)  
  end
break
end
senderId, message, distance = rednet.receive()
  if message == "validuser" then
	accountaccess = true
  end
elseif message == "withdraw" then
  senderId, message, distance = rednet.receive()
  rednet.send(accountsId, message, true)
elseif message== "deposit" then
  senderId, message, distance = rednet.receive()
  rednet.send(accountsId, message, true)
elseif message == "create new account" then
  senderId, message, distance = rednet.receive()
  table.insert(pin, message)
  for i,v in ipairs(pin) do
	if message == v then
	local newaccount = (account[i])
	rednet.send(senderId, newaccount, true)
  end
end  
elseif message == "wire transfer" then
--wire transfer code
else
end
end
while true do
accountlogin()
end



#130220 Easier way of writing all this code

Posted by xbsktball10x on 29 June 2013 - 04:50 PM in Ask a Pro

thats awesome thanks i will try it out saves me alot of typing XD



#130007 Easier way of writing all this code

Posted by xbsktball10x on 28 June 2013 - 01:15 PM in Ask a Pro

Im writing a code for a banking system using turtles and I am using the minefactory reloaded deep storage unit as the accounts so i can only pull out stacks of 64 at a time(this storage unit can hold nearly 2 billion blocks). I was wondering if there was a way to loop the program to pull out the correct number of stacks in order to fulfill the request for money out of the account. ie. lets say i wanted to pull out 300 dollars then i would have to pull out 5 stacks and then drop 300 then put the remainder back in the account. right now i have it set up so that it checks the number they want and if its with in a certain range then it pulls out the right number of stacks but it is a quite lengthy process the code goes

rednet.open("right")
repeat
    turtle.turnLeft()
until turtle.compareTo(16) == true
local senderId, message, distance = rednet.receive()
if message <= 64 then
    turtle.suck()
elseif message > 64 and <=128 then
    turtle.suck()
    turtle.suck()  
elseif message >128 and <=192 then
    turtle.suck()
    turtle.suck()
    turtle.suck()
elseif message >192 and <=256 then
    for i = 1,4 do
        turtle.suck()
    end   
elseif message >256 and <=320 then
    for i = 1,5 do
        turtle.suck()
    end
elseif message >320 and <= 384 then
    for i = 1,6 do
        turtle.suck()
    end
elseif message >384 and <=448 then
    for i = 1,7 do
        turtle.suck()
    end
elseif message >448 and <= 512 then
    for i= 1,8 do
        turtle.suck()
    end
elseif message >512 and <= 576 then
    for i= 1,9 do
        turtle.suck()
    end
elseif message >576 and <= 640 then
    for i = 1,10 do
        turtle.suck()
    end
end

is there anyway to make this into a loop?