The way I would do it in c++ (i only understand c++, lua looks like gobbledeegook) :
// - double slash = comment in c++/java for lua-only people :)/>/>/>
// computer 1
string itemType = " "
string amount = " "
std::cout << "type Item type"; // standard c++ output
std::cin >> itemType; //standard c++ input
rednet.open ("right");
rednet.broadcast (itemType);
id, message = rednet.recieve();
if (message == "has item")
{
std::cout << "Amount?";
std::cin >> amount;
rednet.broadcast (amount);
id, message = rednet.recieve();
if (message == "has amount")
{
std::cout << "Everything clear. Will recieve items.";
}
if (message != "has item") // != is the not operator in c++ / any language w/ boolean operators
{
std::cout << "Not enough Items, sorry.";
}
}
if (message != "has item")
{
std::cout << "No item of that type in storage, sorry."
}
I have been using c++ for so long, I don't even begin to understand lua. Everything I try to write is semicoloned and with {} brackets
Edited by Jsb, 09 December 2013 - 09:15 PM.












