Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer visible = TRUE;
- vector defaultsize;
- //Random number variable
- float FloatValue;
- integer IntValue;
- string StringValue;
- integer lchan;
- integer mchan; //menu channel
- integer mhandle;
- key owner;
- //key id;
- integer nchan; // to get answer channel
- integer cchan; //2nd menu channel
- integer chandle;
- integer nextmenu; //check for if the 1st menu was answered
- float FloatValue2;
- integer IntValue2;
- string StringValue2;
- integer fishdrop = FALSE;
- list leaderboard;
- integer totalpoints;
- string username;
- key unowner;
- key lid;
- string lusername;
- string ltotalpoints;
- string cmd2;
- float fishingtime;
- float fishingcounter;
- integer ifishingtime;
- integer animation = FALSE;
- integer stopmtimer = TRUE;
- addpoints()
- {
- totalpoints += 1;
- }
- show()
- {
- llSetAlpha(1,ALL_SIDES);
- visible = TRUE;
- return;
- }
- hide()
- {
- llSetAlpha(0,ALL_SIDES);
- visible = FALSE;
- return;
- }
- Ssize()
- {
- llSetScale(defaultsize/4);
- }
- Msize()
- {
- llSetScale(defaultsize/2);
- }
- Bsize()
- {
- llSetScale(defaultsize);
- }
- Randomcolor()
- {
- //Red:4,blue:5,green:6,yellow:7,black:8,white:9
- if(StringValue2=="4") // Red
- {
- llSetLinkColor(LINK_THIS, <1.0, 0.0, 0.0>, ALL_SIDES);
- }
- else if(StringValue2=="5") // Blue
- {
- llSetLinkColor(LINK_THIS, <0.0, 0.0, 1.0>, ALL_SIDES);
- }
- else if(StringValue2=="6") // Green
- {
- llSetLinkColor(LINK_THIS, <0.0, 1.0, 0.0>, ALL_SIDES);
- }
- else if(StringValue2=="7") // Yellow
- {
- llSetLinkColor(LINK_THIS, <1.0, 1.0, 0.0>, ALL_SIDES);
- }
- else if(StringValue2=="8") // Black
- {
- llSetLinkColor(LINK_THIS, <0.0, 0.0, 0.0>, ALL_SIDES);
- }
- else if(StringValue2=="9") // White
- {
- llSetLinkColor(LINK_THIS, <1.0, 1.0, 1.0>, ALL_SIDES);
- }
- }
- integer GetCh(key id) // make a unieq channel from the key inputted
- {
- return ((integer)("0x"+llGetSubString((string)id,-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF;
- }
- key Region() // get the region uuid
- {
- vector z = llGetRegionCorner();
- return (key)((string)(z.x/256 + 100*z.y));
- }
- integer allow; // First use a boolean to only allow fishing again once an answer has been given.
- list ans; // we also need a list to store the buttons.
- list ans2;
- Timer()
- {
- llSetTimerEvent(0.0);
- llSetTimerEvent(60.0);
- }
- default
- {
- attach(key id)
- {
- if(id)
- llResetScript();
- }
- state_entry()
- {
- nextmenu = FALSE;
- allow = TRUE; // allow fishing
- owner = llGetOwner();
- llListen(-11223,"Fish Pond",NULL_KEY,"");
- llSetAlpha(0,ALL_SIDES);
- defaultsize = <0.4/6, 2.0/6, 5.0/6>;
- llSetScale(defaultsize);
- lchan = ((integer)("0x"+llGetSubString((string)llGetOwner(),-8,-1)) - 723) | 0x8000000;
- llListen(lchan,"Fish Pond",NULL_KEY,"");
- llListen(-66778,"Fishing Rod",NULL_KEY,"");
- }
- listen(integer channel, string what, key who, string msg)
- {
- if(msg == "on" && allow ) // 13. Remember to check the parsed message.
- {
- hide();
- llSetScale(defaultsize);
- }
- else if(msg == "off" && allow ) // only catch a fish if allowed
- {
- state run_animation;
- }
- }
- }
- state run_menu
- {
- state_entry()
- {
- }
- }
- state run_animation
- {
- state_entry()
- {
- //
- nextmenu = FALSE;
- allow = TRUE; // allow fishing
- owner = llGetOwner();
- llListen(-11223,"Fish Pond",NULL_KEY,"");
- lchan = ((integer)("0x"+llGetSubString((string)llGetOwner(),-8,-1)) - 723) | 0x8000000;
- llListen(lchan,"Fish Pond",NULL_KEY,"");
- llListen(-66778,"Fishing Rod",NULL_KEY,"");
- //
- key ownerid;
- ownerid = llGetOwner();
- llSay(0, "The script entered state 'run_animation'");
- llMessageLinked(LINK_SET, 0, "animate", ownerid);
- }
- listen(integer channel, string what, key who, string msg)
- {
- if(msg == "on" && allow ) // 13. Remember to check the parsed message.
- {
- hide();
- llSetScale(defaultsize);
- }
- }
- link_message(integer from, integer chan, string msg, key who)
- {
- key ownerid;
- ownerid = llGetOwner();
- if(msg == "stopanimate"&& who == ownerid )
- {
- animation = FALSE;
- show();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement