Author Topic: kid has even more questions about TS  (Read 4152 times)

im pulling together my own chatbot (for learning purposes not actually gonna use it (maybe in very rare circumstances idk)) and, i want to make it myself only able to active it but since i change my name about i want to pull the BL:ID from the chat so it can verify it instead of cehcking the name. How to?
« Last Edit: December 10, 2017, 10:38:30 AM by SubDaWoofer »

There's a function that reads through the f2 player list . If you properly substring and trim the feed you'll be able to read the bl-Ids of people, but it's semi difficult because half of the feed is random characters

There's a function that reads through the f2 player list . If you properly substring and trim the feed you'll be able to read the bl-Ids of people, but it's semi difficult because half of the feed is random characters
alright ill see if i can find it

Don't try, it's impossible. Until someone posts the function, brush up on string functions such as sub strings, trimming, get word and other stuff because you absolutely need it

another question:
i attempted something like this
Code: [Select]
if (%msg $= "*^ENABLE & %name $= "Stefan Burnett")
{
and it doesnt report back errors when i enable the package its in, but what it does is like prevent my chat from going through or seeing it
what did i do wrong

edit:
was digging through port's old eval code
found a subfunction
Code: [Select]
%this.getBLID() = xxxxx
« Last Edit: December 09, 2017, 05:53:08 PM by SubDaWoofer »

if you only want it to work for yourself, it might make more sense to just read your own chat going out, rather than all chat going in
similar to truce's build text script

if you only want it to work for yourself, it might make more sense to just read your own chat going out, rather than all chat going in
similar to truce's build text script
if you could post the link to that it would be helpful
all i need is a link to the download, i can strip it apart with VIM

another question:
i attempted something like this
Code: [Select]
if (%msg $= "*^ENABLE & %name $= "Stefan Burnett")
{
and it doesnt report back errors when i enable the package its in, but what it does is like prevent my chat from going through or seeing it
what did i do wrong

edit:
was digging through port's old eval code
found a subfunction
Code: [Select]
%this.getBLID() = xxxxx
you forgot a closing quote on quote after ENABLE. Also jumping into torque script without fully understanding it's syntax is a recipe for disaster
« Last Edit: December 09, 2017, 08:20:38 PM by PhantOS »

you forgot a closing quote on quote after ENABLE. Also jumping into torque script without fully understanding it's syntax is a recipe for disaster
oh stuff im handicapped
so it should be
Code: [Select]
if ((%msg $= "*^ENABLE) & (%name $= "Stefan Burnett"))
{
which defautls to
Code: [Select]
if ((1) & (1)) {
which is true
damnit

That's optional. I'm talking about " " <<these. You have an opening quote "*^ENABLE but forgot the closing one

iirc the function you want to package is clientcmdmessageSent, but im not 100% sure. i don't have any decompiled files on me atm so i cant check :(

basically would let you catch any messages you send from your client, and not just catch the entire stream of chat incoming.

That's optional. I'm talking about " " <<these. You have an opening quote "*^ENABLE but forgot the closing one
stuff IM DUMB
how did i not catch that

edit:
wait no thats fixed on my actual code
it still does the weird thing with the fix
ill copy paste my code once i figure out why the hell my VIM isnt compatable with my clipboard
Code: [Select]
//ChatBot Version ELI
//Made by Stefan Burnett!
//Alright lets get this on with.


package ChatBotGeneral
{
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
{
parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
if (%msg $= "*^Test")
{
if (%name $= "Stefan Burnett")
{
commandToServer('messagesent',"ELI: Testing Complete");
}
}
}
};

package Enable
{
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
{
parent::clientCmdChatMessage(%a,%b,%c,$fmsg,%cp,%name,%cs,%msg);
if (%msg $= "*^ENABLE" & %name $= "Stefan Burnett")
{
activatePackage(ChatBotGeneral);
}
else if (%msg $= "*^DISABLE" & %name $= "Stefan Burnett")
{
disablePackage(ChatBotGeneral);
}
}
};
activatePackage(Enable);

iirc the function you want to package is clientcmdmessageSent, but im not 100% sure. i don't have any decompiled files on me atm so i cant check :(

basically would let you catch any messages you send from your client, and not just catch the entire stream of chat incoming.
would its variables still be the same as clientcmdchatmessage(%a,%b...)
« Last Edit: December 09, 2017, 09:44:59 PM by SubDaWoofer »

https://leopard.hosting/dl/xrfpi/Script_BuildChar.zip

Code: [Select]
package buildChar
{
function NMH_Type::send(%this)
{
%msg=%this.getValue();
Parent::send(%this);
if(getWord(%msg,0)$="@BT")
...
}
};
activatePackage(buildChar);

https://leopard.hosting/dl/xrfpi/Script_BuildChar.zip

Code: [Select]
package buildChar
{
function NMH_Type::send(%this)
{
%msg=%this.getValue();
Parent::send(%this);
if(getWord(%msg,0)$="@BT")
...
}
};
activatePackage(buildChar);
thank

excuse me but i am a dumb and new (not really new but last time i programmed was like 2-3 yrs ago) to programming may you answer some of my questions:

what the hell does the parent:: do (does it overwrite a function?) i still do not know
what is NMH:: type?  NMHclass::function
what does "::" do? alright this defines a function or variable of a ClassName
« Last Edit: December 10, 2017, 12:02:02 PM by SubDaWoofer »