Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

tempmute | !tempunmute commands

ツ
Loyal Member
Joined
Apr 12, 2008
Messages
729
Reaction score
28
Aight, so i was really bored, and i decided to try and make a fun command in my spare time.

Major credits go to: Sathon
I just basically edited his !leeton scripts, so ty to him :D.



Anyways, what this should do is, make it so all of the characters you type, because a's, and it should make it so if there is more the 0 a's in the sentence, it will just send nothing. Kind of like the "DISREGARD THAT I SUCK penis" message, but i just removed it.


CommandProcessor.java
Code:
else if (splitted[0].equals("!tempmute"))
            {
                MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
                victim.setTempMute(true);
                mc.dropMessage("You have made " + victim.getName() + " unable to talk.");
 
                ServernoticeMapleClientMessageCallback cm = new ServernoticeMapleClientMessageCallback(victim.getClient());
 
                if(!(c.getPlayer().getName().equals(victim.getName())))
                {
                    cm.dropMessage("You were extremely annoying, so a GM has taken away your abilities to talk.");
                }
 
            }
 
            else if (splitted[0].equals("!tempunmute"))
            {
                MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
                victim.setTempMute(false);
                mc.dropMessage("You have made " + victim.getName() + " able to talk again.");
 
                ServernoticeMapleClientMessageCallback cm = new ServernoticeMapleClientMessageCallback(victim.getClient());
 
                if(!(c.getPlayer().getName().equals(victim.getName())))
                {
                    cm.dropMessage("It seems the GMs took pity on you, you may talk again.");
                }
            }
MapleCharacter.java,
after this line:
Code:
private boolean gm;

add this line:
Code:
private boolean TempMute;


MapleCharacter.java,
after this line:
Code:
setPosition(new Point(0, 0));
add this line:
Code:
TempMute = false;



MapleCharacter.java,
after this code:

Code:
public void setLevel(int level) {
            this.level = level-1;
    }

add this code:
Code:
public boolean getTempMute()
    {
        return TempMute;
    }
 
    public void setTempMute(boolean setTo)
    {
        TempMute = setTo;
    }



GeneralChatHandler.java,
after this code:

Code:
if (StringUtil.countCharacters(text, '@') > 4 || StringUtil.countCharacters(text, '%') > 4 ||
                StringUtil.countCharacters(text, '+') > 6 || StringUtil.countCharacters(text, '$') > 6 ||
                StringUtil.countCharacters(text, '&') > 6 || StringUtil.countCharacters(text, '~') > 6 ||
                StringUtil.countCharacters(text, 'W') > 6) {
                text = "DISREGARD THAT I SUCK penis";
            }

add this code:


Code:
if(c.getPlayer().getTempMute()) {
                String normal = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
                String TempMute = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
                for(int i = 0; i < 52; i++)
    {
                    text = text.replace(normal.charAt(i), TempMute.charAt(i));
                }
   if (StringUtil.countCharacters(text, 'a') > 0  {
   text = "";
}
 
}




This code is UNTESTED, i didnt really have the time to go in and test it. So if i made any mistakes, please post corrections, and ill be glad to fix them. Im not exactly the best coder out there, just tryin to help :p

This is just a makeshift mute, it doesnt mute from smegas/guild/buddy/party chat, just general chat. Good for when people get really annoying :p


Like i said, most credits to Sathon, i just basically edited his script.




Feedback is always great, like to know what u guys think :p
 
Newbie Spellweaver
Joined
Jul 3, 2008
Messages
11
Reaction score
0
Re: [RELEASE] !tempmute | !tempunmute commands

Nice.
 
Master Summoner
Loyal Member
Joined
Jul 22, 2008
Messages
573
Reaction score
0
Re: [RELEASE] !tempmute | !tempunmute commands

nice, but i still hope that someone testing it.
nice if it works
 
&#12484;
Loyal Member
Joined
Apr 12, 2008
Messages
729
Reaction score
28
Re: [RELEASE] !tempmute | !tempunmute commands

@ ReboC
Lol did u test it even? o.o


@Espada

It should work, i dont think i did anything wrong x.X
 
Master Summoner
Loyal Member
Joined
Jul 22, 2008
Messages
573
Reaction score
0
Re: [RELEASE] !tempmute | !tempunmute commands

oh then i'll test it tmr, busy with works now.
 
IHF
Joined
Apr 7, 2008
Messages
312
Reaction score
0
Re: [RELEASE] !tempmute | !tempunmute commands

Didn't iGoofy made something like this ? o.o
 
&#12484;
Loyal Member
Joined
Apr 12, 2008
Messages
729
Reaction score
28
Re: [RELEASE] !tempmute | !tempunmute commands

Yea, but i could never get his script working, it never muted the person. Lol
 
Experienced Elementalist
Joined
Jul 8, 2008
Messages
246
Reaction score
0
Re: [RELEASE] !tempmute | !tempunmute commands

why dont ppl just test before they release,
what good is 'not tested'
You have time to write the code but not test it, shows just how much effort you put into your work
 
&#12484;
Loyal Member
Joined
Apr 12, 2008
Messages
729
Reaction score
28
Re: [RELEASE] !tempmute | !tempunmute commands

why dont ppl just test before they release,
what good is 'not tested'
You have time to write the code but not test it, shows just how much effort you put into your work

You got sumthin up your butt this mornin...?

People are currently playing on my server, if i had to restart everyone 2 minutes because of a "typo" or something like that, i dont think they would appreciate it. Also, this code didnt take very long, like i said, its basically Sathons script, with a few edits by me. I didnt have to take a ton of time to write this, i thought of the idea last nite, and it took me, idk, 5 minutes to put it here once i got online?


Instead of bitchin in my thread, why dont u go sumwhere else, eh?
 
Experienced Elementalist
Joined
Jul 8, 2008
Messages
246
Reaction score
0
Re: [RELEASE] !tempmute | !tempunmute commands

Im not bitching, but releasing untested stuff, imagine if medics did that
'cure for cancer, ill just pop this on the market im sure its works. NOTICE UNTESTED'
What good isit, also you gotta be able to have a test server.
 
&#12484;
Loyal Member
Joined
Apr 12, 2008
Messages
729
Reaction score
28
Re: [RELEASE] !tempmute | !tempunmute commands

Im not bitching, but releasing untested stuff, imagine if medics did that
'cure for cancer, ill just pop this on the market im sure its works. NOTICE UNTESTED'
What good isit, also you gotta be able to have a test server.

Good thing im not a medic then eh? And releasing untested stuff is how everything gets made. Im sure odinms put some "untested" stuff out there for their devs, and look where odin is now. If you dont want to use it, dont, im not trying to make you. But seriously, please take your next right and gtfo of my thread.
 
Legendary Battlemage
Joined
May 23, 2008
Messages
628
Reaction score
4
Re: [RELEASE] !tempmute | !tempunmute commands

why dont ppl just test before they release,
what good is 'not tested'
You have time to write the code but not test it, shows just how much effort you put into your work

He has a point you know >_>
 
&#12484;
Loyal Member
Joined
Apr 12, 2008
Messages
729
Reaction score
28
Re: [RELEASE] !tempmute | !tempunmute commands

Feelin da love here....guess thats what ppl get for trying to help >.>
 
Mythic Archon
Loyal Member
Joined
Jul 23, 2008
Messages
796
Reaction score
56
Re: [RELEASE] !tempmute | !tempunmute commands

If it doesn't work, fix it so that it works. !mute works btw.
Anyways this works better because the !mute has some pretty big glitches.
This should work 100% because it's bascially the same as the smegaon and smegaoff command

Even better for this is
Code:
if(c.getPlayer().getTempMute()) {
                                 String normal = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
                String TempMute = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
                                    for(int i = 0; i < 62; i++){
                                              text = text.replace(normal.charAt(i), TempMute.charAt(i));
                                              }
                       if (StringUtil.countCharacters(text, 'a') > 0)  {
                                        text = "";}}
Because with your code, the user can still spam numbers. The only error with this code is that the user says "" which is like a blank.
So I prefer
Code:
 if (StringUtil.countCharacters(text, 'a') > 0)  {
                                        text = "DISREGARD THAT I SUCK penis";}}

-edit- ok before people start laming about how other spam is possible (i.e. * & ^ $ { [ ] }), just add that in yourself
 
&#12484;
Loyal Member
Joined
Apr 12, 2008
Messages
729
Reaction score
28
Re: [RELEASE] !tempmute | !tempunmute commands

If it doesn't work, fix it so that it works. !mute works btw.
Anyways this works better because the !mute has some glitches.
Even better for this is

-edit- ok before people start laming about how other spam is possible (i.e. * & ^ $ { [ ] }), just add that in yourself



Im glad sum1 apreciates it :p.

This was just a quick write up, there would be more to add (i.e. numbers, special chars, ect). But its just a quick thing i made.


Hope u guys enjoi :p




Edit: Will a blank give errors or anything? I thought adding a blank would just make it so the person says nothing ea time.
 
Newbie Spellweaver
Joined
Jun 22, 2008
Messages
17
Reaction score
0
Re: [RELEASE] !tempmute | !tempunmute commands

Though yours is a different way, isn't iGoofy's release be a much better mute..?

 
&#12484;
Loyal Member
Joined
Apr 12, 2008
Messages
729
Reaction score
28
Re: [RELEASE] !tempmute | !tempunmute commands

As moogra said, !mute has glitches, and doesnt work for some people. Its also a lot more complicated then this 1 lol, if you want to use goofy's go ahead. Just thought id try n help some people out.
 
Legendary Battlemage
Joined
May 23, 2008
Messages
628
Reaction score
4
Re: [RELEASE] !tempmute | !tempunmute commands

I like iGoofy's method :)
 
You've got my respect!
Joined
Apr 8, 2008
Messages
508
Reaction score
147
Re: [RELEASE] !tempmute | !tempunmute commands

You should make it mute everything, IE whispers, party, buddy, guild, smegas and maybe make it save.
 
&#12484;
Loyal Member
Joined
Apr 12, 2008
Messages
729
Reaction score
28
Re: [RELEASE] !tempmute | !tempunmute commands

You should make it mute everything, IE whispers, party, buddy, guild, smegas and maybe make it save.

Lol, its just a temp mute...not a full fledged mute. This is just a really quick script, so it doesnt do too much.
 
Back
Top