Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

HTTP_REQUEST Error

DelPiero Endrizzi
Registered User
Join date: 16 May 2009
Posts: 2
05-29-2009 14:51
Hello everyone,

I'm getting an error while trying to execute this script, it's still not completed yet, but that's not important.. the first event is.. which is where the error occurs.

when i execute it, i works till it leaves the [state entery] then i get this error message..

From: someone

Malkie Talkie-DelPiero Endrizzi: HTTP parameter key 1 is not an integer


i have never seen it before... and i have no idea how to fix it. if anyone got any clue what seems to be the problem.. i'd appreciate it.. thank you


From: someone

// Malka Com channel
// DelPiero Endrizzi
// Malkavians Rock!!

string CheckAvatar = "http://www.website.com/page.php?action=";
string ChannelRequest = "http://www.website.com/channel.php";
string Owner;

key CheckAvatarKey;

key GetChannel;

integer BrodcastChannel;
//integer ListenChannel;

default
{
state_entry()
{
Owner = llKey2Name(llGetOwner());
llSetObjectName("Malkie Talkie-"+Owner);
llSetObjectDesc(llEscapeURL(Owner));
llOwnerSay("Welcome to Malka's Communication Center!";);
llOwnerSay("Checking for permissions.. Please wait!";);
CheckAvatarKey = llHTTPRequest(CheckAvatar+llEscapeURL(Owner),[""],"";);
}


http_response(key request_id, integer status, list metadata, string body)
{
llSay(0, Owner);
if(request_id != CheckAvatarKey){
llOwnerSay("Sorry!, There was an error occurred while trying to connect to server, please detach and reattach in a minute";);
llDetachFromAvatar();
}else if(status = 499){
llOwnerSay("Sorry!, There was an error occurred while trying to connect to server, please detach and reattach in a minute";);
llDetachFromAvatar();
}else if(status != 200){
llOwnerSay("Sorry!, There was an error occurred while trying to connect to server, please detach and reattach in a minute";);
llDetachFromAvatar();
}else if(body != "test";){
llOwnerSay("Sorry, You have no permission to use this device, Goodbye!";);
llDetachFromAvatar();
}else{
llOwnerSay("Thank you "+(string)Owner+" for waiting, you are now connected to the MCC";);
state logged;
}
}
}


state logged
{
state_entry()
{
GetChannel = llHTTPRequest(ChannelRequest,[""],"";);
}

http_response(key request_id, integer status, list metadata, string body)
{
if(status == 499)
{
llOwnerSay("Sorry!, There was an error occurred while trying to connect to server, please detach and reattach in a minute";);
llDetachFromAvatar();
}
else if(status != 200)
{
llOwnerSay("Sorry!, There was an error occurred while trying to connect to server, please detach and reattach in a minute";);
llDetachFromAvatar();
}
else if(status = 200){
BrodcastChannel = (integer)body;
llSay(0 ,body);
state online;
}else{
llOwnerSay("Sorry!, There was an error occurred while trying to connect to server, please detach and reattach in a minute";);
llDetachFromAvatar();
}
}
}


state online
{
state_entry()
{
llListen(BrodcastChannel,"",Owner,"";);
}

listen(integer channel, string name, key id, string message)
{
llOwnerSay(message);
}
}
Cerise Sorbet
Registered User
Join date: 8 Jun 2008
Posts: 254
05-29-2009 15:18
Hi DelPiero! It is just a tiny mistake.

You got this line.

CheckAvatarKey = llHTTPRequest(CheckAvatar+llEscapeURL(Owner),[""],"";);

LSL wants just integers in the parameters so take out the quotation marks.

CheckAvatarKey = llHTTPRequest(CheckAvatar+llEscapeURL(Owner),[],"";);

The other ones have to change the same way. The script is still sad because it does not have PERMISSION_ATTACH for all the llDetachFromAvatar in there.
DelPiero Endrizzi
Registered User
Join date: 16 May 2009
Posts: 2
05-29-2009 19:10
aww. thank you Cerise for all your help.. thank you soo much :)

i totally forgot..