Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

avatar detection help

Dave Braess
Registered User
Join date: 6 Jun 2006
Posts: 33
04-18-2007 21:29
Please help ! I am a total dork when it comes to scripting but at least I keep plugging along ! need some help with a radar I ma building to detect avatar pay status, I cant even get it to compile, and my eyes are bloodshot from trying to figure it out
Dave Braess
Registered User
Join date: 6 Jun 2006
Posts: 33
heres the script
04-18-2007 21:29
default {

touch_start(integer num_detected)
{
llRequestAgentData(llDetectedKey(0), DATA_PAYINFO);
}
dataserver(key queryid, string data)
{if (data=1)
llSay(0, "NO PAYMENT" )
else
llSay(0, "PAYMENT VERIFIED";)}

}
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-19-2007 00:48
A couple of pure syntax errors (misisng semi colons, = instead of ==) and also a misunderstanding of the return from llRequestAgentData. The result is a bit field not a straight integer.

Bit 0: PAYMENT_INFO_ON_FILE Payment info on file
Bit 1: PAYMENT_INFO_USED Payment info used.

CODE


list info = [ "No Payment Info on File" ,
"Payment Info on File" ,
"Beta/Lifetime user" ,
"Payment Info on File AND Payment Info Used" ];

default
{
touch_start(integer num_detected)
{
llRequestAgentData(llDetectedKey(0), DATA_PAYINFO);
}
dataserver(key queryid, string data)
{
integer bits = (integer)data;
llSay(0, "Result " + data + " = " + llList2String(info, bits) );
}

}
Dave Braess
Registered User
Join date: 6 Jun 2006
Posts: 33
thanks Newgate
04-19-2007 06:27
thanks --you saved my life !!
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-19-2007 07:31
From: Dave Braess
thanks --you saved my life !!


I'd suggest that you take a read through the New Scripters Start Here (FAQ)sticky at the top of the forum. It cover teh basic's.

I'd also suggest that you grab hold of a copy of lslint, it is a useful tool for highlighting gross syntax errors and has far more meaningful error messages than the SL editor.
RobbyRacoon Olmstead
Red warrior is hungry!
Join date: 20 Sep 2006
Posts: 1,821
04-19-2007 07:49
From: Newgate Ludd
I'd also suggest that you grab hold of a copy of lslint, it is a useful tool for highlighting gross syntax errors and has far more meaningful error messages than the SL editor.



lslint is indispensable. Really. I very rarely use the in-world tools for scripting anymore (and then only for one-line changes to existing scripts), I just use SciteEZ and lslint to write the scripts and copy and paste them in-world. It is painless, easy, and increases productivity *significantly*.



.
_____________________
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-19-2007 08:06
From: RobbyRacoon Olmstead
lslint is indispensable. Really. I very rarely use the in-world tools for scripting anymore (and then only for one-line changes to existing scripts), I just use SciteEZ and lslint to write the scripts and copy and paste them in-world. It is painless, easy, and increases productivity *significantly*.



.


VERY *significantly*.
Dave Braess
Registered User
Join date: 6 Jun 2006
Posts: 33
thanks to all
04-19-2007 18:13
thank you I have taken scripting classes in-world, read lots in forums and lsl guides and tried a lot of things, and and don't consider myself somone that'scompletley technolology challenged, but many times Im left thinking what the f&^* ! Anyway thanks again Ill try those suggestions maybe it will help me a lot more
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-20-2007 00:13
From: Dave Braess
thank you I have taken scripting classes in-world, read lots in forums and lsl guides and tried a lot of things, and and don't consider myself somone that'scompletley technolology challenged, but many times Im left thinking what the f&^* ! Anyway thanks again Ill try those suggestions maybe it will help me a lot more


No Worries Dave. Please dont be disheartened by minor set backs. My comments where not suggested as criticism just away to gain more information and hence a better understanding. Most of your errors where due to lack of experience which can only be gained by doing.