Script Request: Auto Tips

Author Topic: Script Request: Auto Tips  (Read 4768 times)


Ok Ill go try it

Still Doesent work it doesent appear in controls the gui setting i cant set it  :nes:
« Last Edit: November 06, 2007, 05:52:04 PM by David »

I'll fix it when I get home.


Are you done fixing it Lol sorry if im bothering you.
i just want my cash mod to Work lol.

If you wanted to load tips from a txt file on the server, and allow clients to turn their own auto tips on/off, this might be better:

Code: [Select]

$AutoTipsDelay = 30; // 30 seconds...

package AutoTip {

   function serverCmdTips(%client) {
      %client.tips = (%client.tips $= "" ? false : !%client.tips);
      %onoff = (%client.tips ? "ON" : "OFF");
      messageClient(%client, '', '\c2Auto-Tips has been turned \c3%1\c2.', %onoff);
   }

   function AutoTipsLoop() {
      %tip = $tip[ getRandom(1, $tipCount) ];

      for(%i = 0; %i < ClientGroup.getCount(); %i++) {
         %client = ClientGroup.getObject(%i);
         if( %client.tips $= "" || %client.tips == 1 )
            messageClient(%client, '', '\c4TIP: \c0%1', %tip);
      }

      $AutoTipsLoop = schedule($AutoTipsDelay * 1000, 0, "AutoTipsLoop");
   }

   function serverCmdToggleAutoTips(%client) {
      if( %client.isAdmin || %client.isSuperAdmin ) {
         if( isEventPending($AutoTipsLoop) ) {
            cancel($AutoTipsLoop);
            %onoff = "OFF";
         } else {
            loadAutoTips();
            AutoTipsLoop();
            %onoff = "ON";
         }
         messageAll('', '\c3%1\c2 has turned Auto-Tips \c3%2\c2.', %client.name, %onoff);
      }
   }

   function loadAutoTips() {
      deleteVariables("$tip*");
      %tipFile = "Add-Ons/tips.txt";

      if( !isFile(%tipFile) ) {
         error("Unable to find tip file:" SPC %tipFile);
         return;
      }

      %file = new FileObject();
      %file.openForRead(%tipFile);
      while( !%file.isEOF() ) {
         %tip = %file.readLine();
          $tip[ $tipCount++ ] = %tip;
      }

      %file.close(); %file.delete();
   }
};
activatePackage(AutoTip);


Clients can type /tips to turn auto tips on/off (for them only).
Admins can type /ToggleAutoTips to globally turn auto tips on/off.

I fixed some stuff. By the way, you have to include a tips.txt file with all the tips you want to load (1 tip per line) in the same directory as the script file this code is in (I assume Add-Ons/). Also, the tips won't start until an admin types /ToggleAutoTips, even after it's loaded.
« Last Edit: November 08, 2007, 05:53:57 PM by exidyne »

I lol'ed but wheres the fix of the Cash Mod

I can't be asked to make it, make it yourself.

BLBank folder is empty and the gui aint showing.

Ahh this is never gonna work.

Maybe this will help!

It's only empty because noones saved because you aren't putting down the triggers.

Whats that mean read console


I also despise you, "ilnessbug".