[Lua] [Error] Http Api
Started by Justy, Apr 12 2012 02:12 AM
11 replies to this topic
#1
Posted 12 April 2012 - 02:12 AM
So, I am trying to create a program that gets the http from http://www.tiny.cc/lolosver but i keep getting a "attempt to index ? (a nil value)"
anyone know how? Thanks if you can.
anyone know how? Thanks if you can.
#2
Posted 12 April 2012 - 02:14 AM
#3
Posted 12 April 2012 - 07:35 AM
yeah we cant really help you if there is no code to look at (the only thing we can really do is tell u what the error means!?)
#4
Posted 12 April 2012 - 11:11 AM
well what u can do is the following thing
/>
the var ver shoud be all the webpage content
/>
but i dont know if tiny.cc is the problem
/>
local file = http.get("http://www.tiny.cc/lolosver")
local ver = file:readAll()
the var ver shoud be all the webpage content
but i dont know if tiny.cc is the problem
#5
Posted 12 April 2012 - 11:50 AM
You probably don't have the http API on. go to .minecraftconfigmod_ComputerCraft.cfg, and change "enableAPI_http=0" to "enableAPI_http=1"
#6
Posted 12 April 2012 - 10:22 PM
Http API Enabled And What I Wanted Was A Explanation Of How It Works. Like Kolpa Did.
EDIT: @Kolpa Using That Code And Adding Only print(ver) I still get test:1:Attempt to index ? (a nil value)
EDIT: @Kolpa Using That Code And Adding Only print(ver) I still get test:1:Attempt to index ? (a nil value)
#7
Posted 13 April 2012 - 06:28 PM
well like i said try to not use the tiny.cc link use the real one so like this:
/>
local file = http.get("http://dl.dropbox.com/u/50273341/version.http")
local ver = file:readAll()
or rename it to .html#9
#10
#11
Posted 14 April 2012 - 11:45 AM
kamnxt, on 14 April 2012 - 08:22 AM, said:
well then
Kolpa, on 13 April 2012 - 06:28 PM, said:
well like i said try to not use the tiny.cc link use the real one so like this:
/>
local file = http.get("http://dl.dropbox.com/u/50273341/version.http")
local ver = file:readAll()
or rename it to .html#12
Posted 14 April 2012 - 11:50 AM
i can code u a php/mysql db ver tool and give u some webspace if u want
/>
/>
okay all set pm me and u get it
/>
and yes it works
/> tested
local file = http.get("http://mastersofarms.no-ip.org/ver.php")
local ver = file:readAll() print(ver)
gonna code a vb ver changer and pm it to u if interested okay all set pm me and u get it
and yes it works
Edited by Kolpa, 14 April 2012 - 12:45 PM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











