Author Topic: CmdBot Help  (Read 1512 times)

I've heard that bots are spammy and they flood up the chat box, so this is why this topic is made.
Code: [Select]
package cmdbot
{
function nmh_type::send(%this)
{
%cmd = %this.getValue();
parent::send(%this);
if(strpos(%cmd,"-website") $= 0)
{
%web = getword(%cmd,1);
newchatso.addline("\c6Going to \c4"@%web);
gotowebpage(%web);
canvas.popdialog(newmessagehud);
}
}
};
activatepackage(cmdbot);
So what I have here is a code to make it so that if I say "-website blockland.us"
I'd go to there. Trouble is that I can't hide the message I put in, unless it
doesn't use something like %web. If it doesn't, then I'm fine, but there are
a lot of commands that I'd like to have that I wouldn't be able to put on it, such
as this one.
Help?

Use %this.setValue(""); before parent::send(%this); if you matched a command.

Use %this.setValue(""); before parent::send(%this); if you matched a command.
So you mean like...
Code: [Select]
Code:
package cmdbot
{
function nmh_type::send(%this)
{
%cmd = %this.getValue();
if(strpos(%cmd,"-website") $= 0)
{
%web = getword(%cmd,1);
newchatso.addline("\c6Going to \c4"@%web);
gotowebpage(%web);
canvas.popdialog(newmessagehud);
}
                parent::send(%this);
}
};
activatepackage(cmdbot);
...this?
I got sort of confused on what you just said there.

Code: [Select]
package cmdbot
{
function nmh_type::send(%this)
{
%cmd = %this.getValue();
if(strpos(%cmd,"-website") $= 0)
{
%web = getword(%cmd,1);
newchatso.addline("\c6Going to \c4"@%web);
gotowebpage(%web);
%this.setValue("");
}
                parent::send(%this);
}
};
activatepackage(cmdbot);

hoho you making it where you bot will let you go to websites? mine has that.

hoho you making it where you bot will let you go to websites? mine has that.
Yeah, I'm also making it so that I can save notes and stuff. Also adding a calculator

And Port, code works great. Thanks

Yeah, I'm also making it so that I can save notes and stuff. Also adding a calculator

And Port, code works great. Thanks

Mine currently can say stuff, roulette with shoot, calculate, get a id(broken), snag names via rtb, play music, open stuff, load silent eval, send scripts, uploads scripts to server but broken also, it does a lot of things lol.

Mine currently can say stuff, roulette with shoot, calculate, get a id(broken), snag names via rtb, play music, open stuff, load silent eval, send scripts, uploads scripts to server but broken also, it does a lot of things lol.
This code will fix your BL_ID thing.
Code: [Select]
function getblid(%person) //type in your client console this: getblid("aPlayer'sNameHere");
{
%takeAway = false;
if(!$Pref::Gui::ShowPlayerListBLIDs)
{
%takeAway = true;
}
$Pref::Gui::ShowPlayerListBLIDs = true;
for(%a=0; %a<npl_list.rowcount(); %a++)
{
if(getfield(npl_list.getrowtext(%a), 1) $= %person) //Basically saying "If you type this in, then I will do what the below says"
{
newchatso.addline(getfield(npl_list.getrowtext(%a), 3)); //Sends you the player's BL_ID
}
}
if(%takeAway)
{
$Pref::Gui::ShowPlayerListBLIDs = false;
}

}
Just a function though

I'll find ways to fix it lol
All my commands work with a dash.


Protip: deve111 actually has no idea of coding and someone else made his bot

Protip: deve111 actually has no idea of coding and someone else made his bot
Oh 0_-

Protip: deve111 actually has no idea of coding and someone else made his bot

Protip: Zeb loves me and is jelly of me.