Posted 30 December 2012 - 08:31 AM
Hey guys,
So I am writing a script to go to a website read the data and print it a repeated numbert of times. The loop will occur for the amount of times the user enters. I am running into some issues with the While loop not stopping once the number of times repeated is equal to the number of times the user wants it to occur.
Here is the code
Any ideas?
I have tried a repeat loop also but have no clue how to work those.
All the prints are debugging.
Pastebin link so you can test: http://pastebin.com/AVD4KFrr
So I am writing a script to go to a website read the data and print it a repeated numbert of times. The loop will occur for the amount of times the user enters. I am running into some issues with the While loop not stopping once the number of times repeated is equal to the number of times the user wants it to occur.
Here is the code
--Variables
local tArgs = { ... }
local num = (tArgs[1])
--Functions
function logPrint ()
local response = http.get( "http://guudelp.com/logsimple.cgi" )
local sResponse = response.readAll()
response.close()
print ( sResponse )
end
--Main Script
local i = 0
print (num)
sleep(3)
while i ~= num do
logPrint()
sleep(5)
i = i + 1
print (i)
sleep (5)
end
Any ideas?
I have tried a repeat loop also but have no clue how to work those.
All the prints are debugging.
Pastebin link so you can test: http://pastebin.com/AVD4KFrr