Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // and the old man said
  2. // WELCOME TO THE JUNGLE BABY
  3.  
  4. integer debugging = TRUE;
  5. string gWhiteListNote = "#whitelist";
  6. string gBlackListNote = "#blacklist";
  7. string gAttackListNote = "#attack";
  8. string gDefenseListNote = "#defense";
  9. integer gUpdateCtrl = -1;
  10. list gNoteList;
  11. integer gNotesTotal;
  12. //funcs
  13. debug(string message)   {
  14.     if(debugging)   llSay(0, "/me ~debug _ "+message);
  15. }
  16. system_update(integer type, integer num) {
  17.     if(type == 0)    {
  18.         debug("started update for gNoteList, first note is "+llList2String(gNoteList,0));
  19.         gUpdateCtrl = 0;
  20.         llGetNumberOfNotecardLines(llList2String(gNoteList,0));
  21.     }
  22.     else if(type == 1)   {
  23.         gNoteList+=num;
  24.     }
  25. }
  26.  
  27. default {
  28.     state_entry()   {
  29.         gNoteList = [gAttackListNote, gBlackListNote, gDefenseListNote, gWhiteListNote, "#test"];
  30.         gNotesTotal = llGetListLength(gNoteList);
  31.         system_update(0,0);
  32.     }
  33.     dataserver(key qid, string data)    {
  34.         debug("current gUpdateCtrl "+(string)gUpdateCtrl+" Data called!, our data is "+data+", and our current not we are on is "+llList2String(gNoteList,gUpdateCtrl)+" QID="+(string)qid);
  35.         if(gUpdateCtrl == -1)   return; //don't have any other sorts of data requests yet
  36.         else if(gUpdateCtrl >= 0)   { //:3 by doing this I think it will be easier to add in another update type n' shit
  37.             system_update(1, (integer)data);
  38.             if((gNotesTotal-1) == gUpdateCtrl) { //need to get out of this loop when we have all notes listed
  39.                 gUpdateCtrl = -1;
  40.                 debug("FINAL NOTES LIST, should be "+(string)gNotesTotal+" strings and "+(string)gNotesTotal+" numbers");
  41.                 debug(llList2CSV(gNoteList));
  42.             }
  43.             else    {
  44.                 llGetNumberOfNotecardLines(llList2String(gNoteList, gUpdateCtrl));
  45.                 gUpdateCtrl += 1;
  46.             }
  47.         }
  48.     }
  49. }
  50.  
  51.  
  52. [17:04]  Pixel Tool 2.0 ~debug _ started update for gNoteList, first note is #attack
  53. [17:04]  Pixel Tool 2.0 ~debug _ current gUpdateCtrl 0 Data called!, our data is 1, and our current not we are on is #attack QID=58885cdc-0623-d86f-eb35-6bed7837a89e
  54. [17:04]  Pixel Tool 2.0 ~debug _ current gUpdateCtrl 1 Data called!, our data is 1, and our current not we are on is #blacklist QID=3ba29372-bfde-7b56-5a24-98a96f330508
  55. [17:04]  Pixel Tool 2.0 ~debug _ current gUpdateCtrl 2 Data called!, our data is 2, and our current not we are on is #defense QID=719f7d3c-1663-8d1c-8e02-ea889b88d090
  56. [17:04]  Pixel Tool 2.0 ~debug _ current gUpdateCtrl 3 Data called!, our data is 3, and our current not we are on is #whitelist QID=e91943c0-9dd5-28d1-59ba-8a6b4abf7cf6
  57. [17:04]  Pixel Tool 2.0 ~debug _ current gUpdateCtrl 4 Data called!, our data is 5, and our current not we are on is #test QID=2e880900-48fc-cac4-1e08-1a18f49f2149
  58. [17:04]  Pixel Tool 2.0 ~debug _ FINAL NOTES LIST, should be 5 strings and 5 numbers
  59. [17:04]  Pixel Tool 2.0 ~debug _ #attack, #blacklist, #defense, #whitelist, #test, 1, 1, 2, 3, 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement