Jump to content

Pug - Play sound when mod is near


Pug

Recommended Posts

was looking in the snippets section earlier for something unrelated and came across the snippet by another user [enter name here] sorry i forgot your name. Anyway i thought instead of logging out or saying something it would be better to play a sound to alert the script user to come back to the pc.

So if anyone wants, here:

	// Mod Alert
		public void findMod() throws InterruptedException {
			List<Player> players = client.getLocalPlayers();
			
		    for(Player p : players) {
		        
		        String currentuser = p.getName();
		        
		        if(currentuser.startsWith("Mod ")) {
		    		try {
		    				java.applet.AudioClip clip = 
		    				java.applet.Applet.newAudioClip(
		    				new java.net.URL("http://www.runeinfinity.com/railroadCrossingBell.wav"));
		    				clip.play();
		    				warn("THERE IS A MOD IN THE AREA, KEEP A CLOSE EYE ON YOUR SCREEN FOR A FEW MINUTES PLEASE.");
		    				sleep(10000);
		    				clip.stop();
		    			} 
		    			catch (java.net.MalformedURLException murle) 
		    			{
		    				System.out.println(murle);
		    			}
		        }
		    }
		}

thoughts welcome.

trolls  will be reported.

 

^_^

Link to comment
Share on other sites

Might be a stupid question but how does I do to use it smile.png

 

the most basic way would be to just call it in your on loop method like:

	public int onLoop()
		    throws InterruptedException
	{
		findMod();
                return 10;
        }

but im sure others can comeup with better ways to implement this. just idea on a basic concept i had an hour ago :)

Would be a good idea, but I guess only for babysitters. Maybe an option for both?

 

yah i thought this, i myself am usually using the other screen for scripting whilst botting on my spare screen. So im always near the computer. what about an email alternative for those who are out ? idk.

Link to comment
Share on other sites

If you are going to do something like this, then you should probably have it running on a separate thread s your bot doesn't just sit there doing nothing. Might be more realistic than just straight up logging out when a JMod is around, but it still doesn't look good if all bots in one area just stood still. 

 

this is how i have it set up in my script, just thought i would provide the idea :) will be up to others how they want to use it,

 

thanks for the feedback though Purple :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...