i have a problem, during a code.
i've maded an API called "MikkelAPI" in that api, i'd make an function called "Continue1()"
But. when it launch the api, it just says:bios:278: bad argument: string expected, got nil
ehm why??
can someone help me out of this???
my code is here:
Spoiler
Code that runs the api and other functions:Spoiler
---[[ SECTION: VARIABLES
D1 = "-"
D2 = "-"
D3 = "-"
D4 = "-"
D5 = "-"
D6 = "-"
D7 = "-"
D8 = "-"
D9 = "-"
D0 = "-"
DX1 = "!"
DX2 = "!"
loop1 = true
loop2 = false
loop3 = false
loop4 = false
loopLogin1 = false
loopLogin2 = false
OptionC = 0
OptionB = 0
Line1 = 0
Line2 = 0
Line3 = 0
Line4 = 0
---]] SECTION: VARIABLES
---[[ SECTION: MENU
function menu1(id, text)
if Line1 == id then
write"-> "
elseif Line1 == 1 then
write" "
end
print(text)
end
function menu2(id, text)
if Line2 == id then
write"-> "
elseif Line2 == 1 then
write" "
end
print(text)
end
function menu3(id, text)
if Line3 == id then
write"-> "
elseif Line3 == 1 then
write" "
end
print(text)
end
---]] SECTION: MENU
---[[ SECTION: LOGIN
while loop1 do
term.clear()
term.setCursorPos(2,1)
menu1(0, "Login")
term.setCursorPos(2,2)
menu1(1, "Exit")
event, key = os.pullEvent("key")
if key == 200 then
if Line1 > 0 then
Line1 = Line1 - 1
end
elseif key == 208 then
if Line1 < 1 then
Line1 = Line1 + 1
end
elseif key == 28 then
if Line1 == 0 then --Login System Automation
loop1 = false
loopLogin1 = true
while loopLogin1 do
term.clear()
term.setCursorPos(1,1)
print("+------------------+")
print("+ Enter Username: +")
print("+------------------+")
sleep(2)
term.setCursorPos(1,2)
term.clearLine()
term.setCursorPos(1,2)
print("+ +")
term.setCursorPos(3,2)
UserName = read()
if UserName == "Admin1" then
sleep(0.6)
term.setCursorPos(1,2)
print("+ Checking input. +")
sleep(2)
term.setCursorPos(1,2)
print("+ Username Found! +")
sleep(1)
term.setCursorPos(1,2)
print("+ Welcome "..UserName.." +")
sleep(1.6)
loopLogin1 = false
loopLogin2 = true
loop2 = true
while loopLogin2 do
while loop2 do
term.clear()
term.setCursorPos(1,1)
print("+------------------+")
print("+ Enter Password! +")
print("+------------------+")
sleep(2)
term.setCursorPos(1,2)
print("+ +")
term.setCursorPos(3,2)
PassWord = read("#")
if PassWord == "0903" then
term.setCursorPos(1,2)
print("+ Checking Input! +")
sleep(2)
term.setCursorPos(1,2)
print("+ Password Correct +")
sleep(2)
term.setCursorPos(1,2)
print("+ Booting Startup +")
sleep(2)
os.loadAPI( MikkelAPI.Continue1(1,1) ) -- HERE IS THE PROBLEM! --
loop1 = false
loop2 = false
loopLogin2 = false
elseif PassWord ~= "0903" then
term.setCursorPos(1,2)
print("+ Checking Input! +")
sleep(2)
term.setCursorPos(1,2)
print("+ Input Incorrect! +")
sleep(1.7)
loopLogin2 = true
loop2 = true
end
end
loop2 = true
loopLogin2 = true
end
elseif UserName ~= "Admin1" then
sleep(0.6)
term.setCursorPos(1,2)
print("+ Checking input. +")
sleep(1.7)
term.setCursorPos(1,2)
print("+ Input Not found! +")
sleep(1)
loopLogin1 = true
end
end
elseif Line1 == 1 then
os.shutdown()
end
loop1 = true
end
end
---]] SECTION: LOGIN
The API code:
Spoiler
---[[MikkelAPI.Continue()]]---
function Continue1(a1,a2)
term.clear()
term.setCursorPos(a1,a2)
print("+------------------------+")
print("+ +")
print("+------------------------+")
end