Jump to content

Hi here I want to insert a modified script for free dance


Dana Carteret
 Share

You are about to reply to a thread that has been inactive for 4763 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

string dances; list dance_buttons; integer chat_channel = -468; integer dance_number; integer total_dancesx = 0; integer dance_numberxx = 0; stopAllDances() { integer total_dances = llGetInventoryNumber(INVENTORY_ANIMATION); total_dancesx = total_dances; integer i = 0; while(i < total_dances) { llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION, i++)); } } integer MAX_BUTS_PER_PAGE = 9; integer current = -1; key lastTouch = NULL_KEY; integer numPages; integer curPage = 0; //Displays the next page of the menu (wraps). pageNext() { curPage++; if (curPage > numPages) curPage = 0; showPage(NULL_KEY); } //Displays the previous page of the menu (wraps). pagePrevious() { curPage--; llSay(0,(string)numPages+" - "+(string)curPage); if (curPage < 0) curPage = numPages; showPage(NULL_KEY); } //Creates the menu and displays it. showPage(key lasttouch) { integer start = curPage * MAX_BUTS_PER_PAGE + curPage; integer end = start + MAX_BUTS_PER_PAGE; list options = llList2List(dance_buttons, start, end); options = llListInsertList(options, ["< Prev"], 0); options = llListInsertList(options, ["Next >"], 2); llDialog(lasttouch, " Currently Playing: "+ llList2String(dance_buttons, current) +" Reset \n\nPick a Station or Ignore:\n Page: " + (string)(curPage + 1) + " of " + (string)(numPages + 1), options, chat_channel); } default { state_entry() { integer total_dances = llGetInventoryNumber(INVENTORY_ANIMATION); integer i = 0; while(i < 8) { dances = (dances = "") + dances + (string)(++i) + " " + llGetInventoryName(INVENTORY_ANIMATION, i) + "\n"; dance_buttons = (dance_buttons = []) + dance_buttons + (string)i; } dance_buttons = (dance_buttons = []) + dance_buttons + "STOP"+"Auto"; llListen(chat_channel, "", NULL_KEY, ""); numPages = llGetListLength(dance_buttons) / MAX_BUTS_PER_PAGE; } touch_start(integer total_number) { showPage(llDetectedKey(0)); } listen(integer channel, string name, key id, string message) { if(message == "STOP") dance_number = -1; else dance_number = (integer)message - 1; llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); if(message == "Auto") { llSetTimerEvent(1.0); } } changed(integer change) { if(change & CHANGED_INVENTORY) llResetScript(); } run_time_permissions(integer perms) { if(perms & PERMISSION_TRIGGER_ANIMATION) { stopAllDances(); if(dance_number > -1) { llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION, dance_number)); } } } timer() { llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION, dance_numberxx)); ++dance_numberxx; integer oprava = total_dancesx-1; if (dance_numberxx > (oprava)) {dance_numberxx = 0;} llSetTimerEvent(30.0); } }
Link to comment
Share on other sites

string dances; list dance_buttons; integer chat_channel = -468; integer dance_number; integer total_dancesx = 0; integer dance_numberxx = 0; stopAllDances() { integer total_dances = llGetInventoryNumber(INVENTORY_ANIMATION); total_dancesx = total_dances; integer i = 0; while(i < total_dances) { llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION, i++)); } } integer MAX_BUTS_PER_PAGE = 9; integer current = -1; key lastTouch = NULL_KEY; integer numPages; integer curPage = 0; //Displays the next page of the menu (wraps). pageNext() { curPage++; if (curPage > numPages) curPage = 0; showPage(NULL_KEY); } //Displays the previous page of the menu (wraps). pagePrevious() { curPage--; llSay(0,(string)numPages+" - "+(string)curPage); if (curPage < 0) curPage = numPages; showPage(NULL_KEY); } //Creates the menu and displays it. showPage(key lasttouch) { integer start = curPage * MAX_BUTS_PER_PAGE + curPage; integer end = start + MAX_BUTS_PER_PAGE; list options = llList2List(dance_buttons, start, end); options = llListInsertList(options, ["< Prev"], 0); options = llListInsertList(options, ["Next >"], 2); llDialog(lasttouch, " Currently Playing: "+ llList2String(dance_buttons, current) +" Reset \n\nPick a Station or Ignore:\n Page: " + (string)(curPage + 1) + " of " + (string)(numPages + 1), options, chat_channel); } default { state_entry() { integer total_dances = llGetInventoryNumber(INVENTORY_ANIMATION); integer i = 0; while(i < 8) { dances = (dances = "") + dances + (string)(++i) + " " + llGetInventoryName(INVENTORY_ANIMATION, i) + "\n"; dance_buttons = (dance_buttons = []) + dance_buttons + (string)i; } dance_buttons = (dance_buttons = []) + dance_buttons + "STOP"+"Auto"; llListen(chat_channel, "", NULL_KEY, ""); numPages = llGetListLength(dance_buttons) / MAX_BUTS_PER_PAGE; } touch_start(integer total_number) { showPage(llDetectedKey(0)); } listen(integer channel, string name, key id, string message) { if(message == "STOP") dance_number = -1; else dance_number = (integer)message - 1; llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION); if(message == "Auto") { llSetTimerEvent(1.0); } } changed(integer change) { if(change & CHANGED_INVENTORY) llResetScript(); } run_time_permissions(integer perms) { if(perms & PERMISSION_TRIGGER_ANIMATION) { stopAllDances(); if(dance_number > -1) { llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION, dance_number)); } } } timer() { llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION, dance_numberxx)); ++dance_numberxx; integer oprava = total_dancesx-1; if (dance_numberxx > (oprava)) {dance_numberxx = 0;} llSetTimerEvent(30.0); } }

Link to comment
Share on other sites

So, is there a question here somewhere?  :smileysurprised:

If you want to post a script so that we can understand your question, click on the square icon that has a C on it (visible at the top of your text edit window), then paste your code into the box that opens.  Close that window and your code should appear in the body of your message with its original indentations and line breaks preserved.

ETA:  OK, I got curious, so I went ahead and removed all the line feeds and indented your script.  It compiles with no problem.  If there's a question here, I can't figure out what it is. 

Link to comment
Share on other sites

It is always a good thing when people share scripts:)
It would be better if it was in the LSL Scripting Library
Even better if the script was uncompressed and in a proper format

Here it is:)

string dances;
list dance_buttons;
integer chat_channel = -468;
integer dance_number;
integer total_dancesx = 0;
integer dance_numberxx = 0;
stopAllDances()
{
integer total_dances = llGetInventoryNumber(INVENTORY_ANIMATION);
total_dancesx = total_dances;
integer i = 0;
while(i < total_dances)
{
llStopAnimation(llGetInventoryName(INVENTORY_ANIMATION, i++));
}
}
integer MAX_BUTS_PER_PAGE = 9;
integer current = -1;
key lastTouch = NULL_KEY;
integer numPages;
integer curPage = 0;

//Displays the next page of the menu (wraps).
pageNext()
{
curPage++;
if (curPage > numPages) curPage = 0;
showPage(NULL_KEY);
}

//Displays the previous page of the menu (wraps).
pagePrevious()
{
curPage--;
llSay(0,(string)numPages+" - "+(string)curPage);
if (curPage < 0) curPage = numPages;
showPage(NULL_KEY);
}

//Creates the menu and displays it.
showPage(key lasttouch)
{
integer start = curPage * MAX_BUTS_PER_PAGE + curPage;
integer end = start + MAX_BUTS_PER_PAGE;
list options = llList2List(dance_buttons, start, end);
options = llListInsertList(options, ["< Prev"], 0);
options = llListInsertList(options, ["Next >"], 2);
llDialog(lasttouch, " Currently Playing: "+ llList2String(dance_buttons, current) +" Reset \n\nPick a Station or Ignore:\n Page: " + (string)(curPage + 1) + " of " + (string)(numPages + 1), options, chat_channel);
}

default
{
state_entry()
{
integer total_dances = llGetInventoryNumber(INVENTORY_ANIMATION);
integer i = 0;
while(i < 8)
{
dances = (dances = "") + dances + (string)(++i) + " " + llGetInventoryName(INVENTORY_ANIMATION, i) + "\n";
dance_buttons = (dance_buttons = []) + dance_buttons + (string)i;
}
dance_buttons = (dance_buttons = []) + dance_buttons + "STOP"+"Auto";
llListen(chat_channel, "", NULL_KEY, "");
numPages = llGetListLength(dance_buttons) / MAX_BUTS_PER_PAGE;
}
touch_start(integer total_number)
{
showPage(llDetectedKey(0));
}
listen(integer channel, string name, key id, string message)
{
if(message == "STOP") dance_number = -1;
else dance_number = (integer)message - 1;
llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION);
if(message == "Auto")
{
llSetTimerEvent(1.0);
}
}
changed(integer change)
{
if(change & CHANGED_INVENTORY) llResetScript();
}
run_time_permissions(integer perms)
{
if(perms & PERMISSION_TRIGGER_ANIMATION)
{
stopAllDances();
if(dance_number > -1)
{
llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION, dance_number));
}
}
}
timer()
{
llStartAnimation(llGetInventoryName(INVENTORY_ANIMATION, dance_numberxx));
++dance_numberxx;
integer oprava = total_dancesx-1;
if (dance_numberxx > (oprava)) {dance_numberxx = 0;} llSetTimerEvent(30.0);
}
}

I myself disclaims any responsibility for the publication and contents of this script

Link to comment
Share on other sites

  • 3 weeks later...
You are about to reply to a thread that has been inactive for 4763 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...