hey its me again i now have this but it isnt working
i want it so it checks on the chat if i get a pm
pms look like this
but the nameof the player can have different color so... can anybody fix this for me?
$${
IFMATCHES(%CHAT%,"\xa7[a-f0-9]From" "\xa7[a-f0-9][aA-zZ]+");
PLAYSOUND("custom.soundz");
ENDIF;
}$$
and? could anybody give me a page where regex for here is explained becuz i learned regex a little different:O
I can't really do regex by heart yet, so i'm not exactly sure what you've written =P
Right off the bat though, your last character group looks wrong, it seems to say:
"a", "a letter between A and z" (is that legal?), or "Z"
What you want instead is [a-zA-Z0-9] (usernames may have numbers)
Also, what is \xa7?, i can't seem to find anything like it in the reference list
The regex to match any color code is §[1-9a-f], so you can put that as an optional in front of your name
If i'm not mistaken, that gray is §8.
hey its me again i now have this but it isnt working
i want it so it checks on the chat if i get a pm
pms look like this
but the nameof the player can have different color so... can anybody fix this for me?
$${
IFMATCHES(%CHAT%,"\xa7[a-f0-9]From" "\xa7[a-f0-9][aA-zZ]+");
PLAYSOUND("custom.soundz");
ENDIF;
}$$
and? could anybody give me a page where regex for here is explained becuz i learned regex a little different:O
That should work. If it doesn't, you may try adding a second \xa7[a-fA-F0-9] before the \w+, in case that is how your server colors names (chat messages can get filled with rouge color codes, trust me).
isnt working MUMFREY help meeeee i need this thing working xd
Do something like
IFMATCHES(%CHAT%,save)
Set(@&chat,%CHAT%)
ENDIF
Then message yourself with the word "save" and leave the game - get the exact line from globalvars.xml - and post it here
If for some reason the code doesn't work just do Set(@&chat,%CHAT%), but then you have to make sure that that message is the last one you see, so it doesn't get overwritten
The Meaning of Life, the Universe, and Everything.
Join Date:
1/7/2011
Posts:
46
Minecraft:
mavman88
Member Details
I have one question
Is there a way to make a button do two command at opposite times i want a script or something that can do this
/mode 1
and after
hit again
mode 2
I have one question
Is there a way to make a button do two command at opposite times i want a script or something that can do this
/mode 1
and after
hit again
mode 2
You can kinda do that, but it's sometimes hard to control which one it tries first so the first time you log on you may need to press it twice
Anyway, here goes
That should all be in a txt file, referenced in a script like $${$$<filename.txt>}$$
(This may not be efficient, for example the stop is useless in the second part, but i wrote it this way so it's easier to understand =P
as far as i've noticed with these simple scripts it doesn't really matter anyway)
I also included an anti-spam value, 2
On my own toggle key i had a problem with double, triple, and even quadruple activations, which made it more of a randomizer
You can kinda do that, but it's sometimes hard to control which one it tries first so the first time you log on you may need to press it twice
Anyway, here goes
That should all be in a txt file, referenced in a script like $${$$<filename.txt>}$$
(This may not be efficient, for example the stop is useless in the second part, but i wrote it this way so it's easier to understand =P
as far as i've noticed with these simple scripts it doesn't really matter anyway)
I also included an anti-spam value, 2
On my own toggle key i had a problem with double, triple, and even quadruple activations, which made it more of a randomizer
Was always looking for an mod or official support to assign things to extra keys. The main reason I downloaded is to switch Sneak to MOUSE4 instead of the CAPSLOCK I have. How do I set it to sneak?
No crafting is available with this mod as of yet
for sneaking, use key state macros and either
$${Keydown(sneak)}$$ $${Keyup(sneak)}$$ in key down and key up
---------------------------------------------------------
Okay, i just hit a brick wall with a script i have...
The problem here is that when someone does
>>faction player color
What it should do is do the command for >>faction player colour and then stop
But it also does the command for >>faction player...
and it fails to then match the reply it got from the server as it did the first time i tested it, so it just echoes the last results
lastmsgname is the name of the player who spoke last, i know this works already
lastmsg is the last thing a player said, without his name
Both this code and the code that gets the last message and splits it into parts are run onChat
This one is run after the other
The relevant parts are the first two large blocks, but i included all of it just in case
Set(&command,"null")
-"faction <player> (faction)-
IFMATCHES(%CHAT%,(?:<.*?>)(.*))
IFMATCHES(%@&lastmsgname%,(Ezzzyy|emeraldfire7|mart3323|Jordan_moore))
Set(&command,%@&lastmsg%)
IFMATCHES(%&command%,>>faction\s(.+?)\s(.+?)\B)
MATCH(%&command%,>>faction\s(.+?)\s(.+?)\b,&facpl,1)
MATCH(%&command%,>>faction\s(.+?)\s(.+?)\b,&facfa,2)
Echo(/Perm player setgroup %&facpl% %&facfa%)
Stop()
ENDIF
IFMATCHES(%&command%,>>faction\s(.+?)\B)
MATCH(%&command%,>>faction\s(.+?)\b,&facpl2,1)
Echo(/Perm player groups %&facpl2%)
DO()
Wait(500ms)
IFMATCHES(%@&chat%,§a\s?is in groups)
Match(%@&chat%,§aPlayer\s?§f\s?(.+?)\s?§a\s?is\sin\sgroups\s\(§f1§a\)\s?§f:(.+),&facpl2chat1,1)
Match(%@&chat%,§aPlayer\s?§f\s?(.+?)\s?§a\s?is\sin\sgroups\s\(§f1§a\)\s?§f:(.+),&facpl2chat2,2)
Echo(&aPlayer&f %&facpl2chat1%&a is in groups (&f1&a):&f%&facpl2chat2%)
Stop()
ENDIF
Loop
ENDIF
IFMATCHES(%&command%,>>factionlist\B)
Echo(/Perm group list)
Wait(2)
Match(%@&chat%,f(.+),&factions,1)
Echo(%&factions%)
ENDIF
IFMATCHES(%@&chat%,>>bot)
Toggle(@bot)
Echo(%@bot%)
STOP()
ENDIF
ENDIF
ENDIF
One example where it failed is:
the second line it sends the command /perm player setgroup player :
and the third line the command /perm player groups thing
<Jordan_Moore> wtf was that >>faction thing
Player thing is now in :.
Player thing is in groups (1): :
<mart3323> Player meshuggahzen is in groups (1): ?fpurple
meshugazzen is a player i tested the second block on, for >>faction player
Alternatively, you can just use $${IFMATCHES(%CHAT%,[sS]omething); Echo(/command);ENDIF;}$$ without bothering with a file, but that will be alot clumsier to edit later on because of how short the text box really is
You're using a flag called afk, however, every button has it's own set of variables
there's an afk on the toggle key and an afk in onchat
to get them to share, you simply need to make it global by prefixing it with @
so you'd get
TOGGLE(@afk);
IF(@afk);
LOG("your now AFK");
SET(@afk);
LOG("%@afk%"); <-debug line?
ELSE;
LOG("your no longer AFK");
UNSET(@afk);
LOG("%@afk%"); <-debug line?
ENDIF;
Is there any way to get the onChat event to take chat message parameters? For example when someone says 'Buying diamonds!' I would ask 'How much?'. If there isn't that would be a good addition.
Is there any way to get the onChat event to take chat message parameters? For example when someone says 'Buying diamonds!' I would ask 'How much?'. If there isn't that would be a good addition.
Yes, they are available in the variable %CHAT% (must be all caps)
You can then use IFMATCHES with it
getting to to recognise when someone is selling diamonds may be difficult, because there are so many different ways to say the same thing, not to mention diamonds shortened to dia. or spelling mistakes, but i'll presume maybe there's an agreed format people use
Could you please help me with my script?
I'm trying to make it so I can execute functions by using chat, so in OnChat I made a test that would respond "Hello!" whenever someone said "Hi."
$${IF(CHAT = "Hi");ECHO("Hello!");ENDIF;}$$
But it didn't do anything when I typed "Hi"
Please help me.
Could you please help me with my script?
I'm trying to make it so I can execute functions by using chat, so in OnChat I made a test that would respond "Hello!" whenever someone said "Hi."
$${IF(CHAT = "Hi");ECHO("Hello!");ENDIF;}$$
But it didn't do anything when I typed "Hi"
Please help me.
Firstly, you need %CHAT%, not CHAT
Secondly, the entire line of chat is one thing, the playername isn't sent separately, so using = won't work anyway
For comparing strings like that, you should use IFMATCHES, which uses Regular Expressions
IFMATCHES(%CHAT%,\b[Hh]i\B)
Echo(Hello)
ENDIF
(This one matches "Hi", "hi", "name, hi there", but not history)
Personally, i use http://www.regular-expressions.info/
I can't really do regex by heart yet, so i'm not exactly sure what you've written =P
Right off the bat though, your last character group looks wrong, it seems to say:
"a", "a letter between A and z" (is that legal?), or "Z"
What you want instead is [a-zA-Z0-9] (usernames may have numbers)
Also, what is \xa7?, i can't seem to find anything like it in the reference list
The regex to match any color code is §[1-9a-f], so you can put that as an optional in front of your name
If i'm not mistaken, that gray is §8.
'Cause tomorrow spring is here
\xa7 matches the Section (§) symbol. It cannot be typed directly ingame, so that is how most of us bypass that.
As Mart said, http://www.regularexpressions.info is a good place to learn RegEx.
To fix your regex, you should probably do something like this:
That should work. If it doesn't, you may try adding a second \xa7[a-fA-F0-9] before the \w+, in case that is how your server colors names (chat messages can get filled with rouge color codes, trust me).
Ah, thanks for the heads-up
Do something like
Then message yourself with the word "save" and leave the game - get the exact line from globalvars.xml - and post it here
If for some reason the code doesn't work just do Set(@&chat,%CHAT%), but then you have to make sure that that message is the last one you see, so it doesn't get overwritten
'Cause tomorrow spring is here
Is there a way to make a button do two command at opposite times i want a script or something that can do this
/mode 1
and after
hit again
mode 2
You can kinda do that, but it's sometimes hard to control which one it tries first so the first time you log on you may need to press it twice
Anyway, here goes
That should all be in a txt file, referenced in a script like $${$$<filename.txt>}$$
(This may not be efficient, for example the stop is useless in the second part, but i wrote it this way so it's easier to understand =P
as far as i've noticed with these simple scripts it doesn't really matter anyway)
I also included an anti-spam value, 2
On my own toggle key i had a problem with double, triple, and even quadruple activations, which made it more of a randomizer
'Cause tomorrow spring is here
There is a much easier way:
TOGGLE() toggles a flag named flag
Macro/Keybind mod Wiki
Also check out EasyJar! Works great with DLML.
Thanks
for sneaking, use key state macros and either
$${Keydown(sneak)}$$ $${Keyup(sneak)}$$ in key down and key up
---------------------------------------------------------
Okay, i just hit a brick wall with a script i have...
The problem here is that when someone does
>>faction player color
What it should do is do the command for >>faction player colour and then stop
But it also does the command for >>faction player...
and it fails to then match the reply it got from the server as it did the first time i tested it, so it just echoes the last results
lastmsgname is the name of the player who spoke last, i know this works already
lastmsg is the last thing a player said, without his name
Both this code and the code that gets the last message and splits it into parts are run onChat
This one is run after the other
The relevant parts are the first two large blocks, but i included all of it just in case
One example where it failed is:
the second line it sends the command /perm player setgroup player :
and the third line the command /perm player groups thing
<Jordan_Moore> wtf was that >>faction thing
Player thing is now in :.
Player thing is in groups (1): :
<mart3323> Player meshuggahzen is in groups (1): ?fpurple
meshugazzen is a player i tested the second block on, for >>faction player
'Cause tomorrow spring is here
Yes, certainly
Go to your events tab and select onChat
put down some $${$$<Filename.txt>}$$
and into that file write
Alternatively, you can just use $${IFMATCHES(%CHAT%,[sS]omething); Echo(/command);ENDIF;}$$ without bothering with a file, but that will be alot clumsier to edit later on because of how short the text box really is
'Cause tomorrow spring is here
Ah, i see
You're using a flag called afk, however, every button has it's own set of variables
there's an afk on the toggle key and an afk in onchat
to get them to share, you simply need to make it global by prefixing it with @
so you'd get
and
'Cause tomorrow spring is here
Yes, they are available in the variable %CHAT% (must be all caps)
You can then use IFMATCHES with it
getting to to recognise when someone is selling diamonds may be difficult, because there are so many different ways to say the same thing, not to mention diamonds shortened to dia. or spelling mistakes, but i'll presume maybe there's an agreed format people use
'Cause tomorrow spring is here
A graphic designer from Perth, Australia.
www.alene.co
So say that this EXACT message pops into chat
Mr.Derpy: Derp!
I would like to be able to toggle in advance whether to respond to it or not with a key.
So when I press B for example it would set a toggle to positive or negative like a NOT gate.
Then in my onChat macro I want it to ask: 'Is the toggle set to positive? If so then say 'hello Mr.Derpy''
It sounds kind of confusing but all I really need to know is about global variables and whether or not they work.
OnChat
Toggle Key
'Cause tomorrow spring is here
I'm trying to make it so I can execute functions by using chat, so in OnChat I made a test that would respond "Hello!" whenever someone said "Hi."
But it didn't do anything when I typed "Hi"
Please help me.
Firstly, you need %CHAT%, not CHAT
Secondly, the entire line of chat is one thing, the playername isn't sent separately, so using = won't work anyway
For comparing strings like that, you should use IFMATCHES, which uses Regular Expressions
(This one matches "Hi", "hi", "name, hi there", but not history)
'Cause tomorrow spring is here
I havent tested it but this should work:
You don't have to click respawn
EDIT: Okay i have tested it now. You have to put the code above in the onHealthChange Event.
Macro/Keybind mod Wiki