1.12.1
1.12
1.11
1.10
1.9.4
1.9
1.8
1.7.10
Liteloader
He wants what the chat you receive looks like, not how you send chat. It can technically be made for any chat, because they must follow some pattern in order to work properly.
That would work, but even better would be if you could temporarily bind the following into onchat
$${LogTo(debug.txt,%CHAT%)}$$
then go onto the server and look at some chat, and grab the contents of that file from /macros/logs
it should look something like this (just an example.., basically it has the name, message, and some weird color codes inside of it)
§4[§aandaerz§4]: §f§rfrost sorceress
Try and "capture" every type of message you want to be able to react to...
if there are different colors or prefixes or ranks, try and get all of them to appear.
or at least let me know which color it is that can change =P
basically, i need a description of how to read that plain text, understand if it's chat or not, and identify the name and message
The example, by the way, meant:
(start)<(anything_min)>_ _ (anything_max)(end)
with the first anything being the name, and the second anything being the message
which works for vanilla chat because that's what it looks like... "<name> message"
Oh, and by the way, nothing is impossible to identify with a regex..., if a human can do it, there's a way to explain it in regex as well
IP adresses, email adresses, valid phone numbers
it's all been done and it's quite easy
'Cause tomorrow spring is here
Oh, but of course it does.., it changes the message from "name: message" to "[ G ] [title]name: message"
This is actually a very complicated chat system to write for.., but maybe we'll get really lucky
here's my first guess
Set(&channel,unknown)
Set(&prefix,unknown)
Set(&type,chat)
MATCH(%CHAT%,"^([^§]+?)? §.(\[(.+?)\])?§f(.+?)§f: §.(.+?)$",{&channel,&prefix,&name,&message})
ENDIF
and here's a fallback that's just barely good enough to get the name and message
IFMATCHES(%CHAT%,"([^:]+)[\s\]]([^:]+?): (.+)$")
Set(&type,chat)
MATCH(%CHAT%,"([^:]+)[\s\]]([^:]+?):$",{&garbage,&name,&message})
ENDIF
I'm afraid they could both fail though, there's just so many things in that chat that are optional.., especially with the G and P and such tags being unknown characters, containing any length inside, being optional =P
Worth a try though.., there you go
Those are for replacing just the "chat filter" part, the rest are fine
If it doesn't work, you can go the easy way and just compare the entire string
i was just trying to do it this way because it's more powerful, but i didn't expect it to also be this complicated in your case
so yeah.., have a simple workaround, but one that only works for identical messages with nothing in between
IF(%CHAT% == %&lastchat%)
Inc(#spamcounter)
ELSE
Set(#spamcounter,0)
ENDIF
Set(&lastchat,%CHAT%)
IF(#spamcounter > 3)
Echo(Stop spamming!)
ENDIF
Or, if the server is public, i might try and test it myself in the weekend.., might be able to figure it out since i get instant feedback that way
'Cause tomorrow spring is here
I guess I could just merge the macros into one, but what if I'd like one macro to fire on all configs, and on a specific config I want a second macro.
Well, i was on your server for a while and i think i figured it out
(and learned a new item in regex..., non-capturing groups)
Set(&type,unknown)
IFMATCHES(%CHATCLEAN%,"^(?:... )?([^:\]]+?): (.+)$")
Set(&type,chat)
MATCH(%CHATCLEAN%,"^(?:... )?([^:\]]+?): (.+)$",{&name,&message})
Set(&rank,unknown)
ENDIF
IFMATCHES(%CHATCLEAN%,"^(?:... )?\[(.+?)\](.+?): (.+?)$")
Set(&type,chat)
MATCH(%CHATCLEAN%,"^(?:... )?\[(.+?)\](.+?): (.+?)$",{&title,&name,&message})
ENDIF
This doesn't identify whether or what letter they have in front of them, but it does capture the name, message, and title, if present
(the title is what i call whatever is in the brackets)
It does include suffixes like VIP in the name though.., if i knew for sure what suffixes are available i can make that separate as well
So Bubma1988 VIP is captured as the name, not just Bumba1988
It's not perfect though..., i just saw it react to what looks like a ban broadcast...
no offense, but the chat on that server is just horrible, both to look at and to program for =P
'Cause tomorrow spring is here
You don't Key or Keydown actual keys, you trigger bindings
Key(attack), KeyDown(forward, etc.
Attack isn't a stateful bind either, so you can't use KeyDown, you have to use Key() repeated
'Cause tomorrow spring is here
log("Autofish Enabled");do;
key(use);
wait(2);
key(use);
wait(200ms);
loop;
At first: This is my favourite mod, so keep up the good work Mumfrey!
I wrote an autocrafting macro for theoretically infinite items, but I have a problem with it.
When I want to craft more than 999 items, it makes more than I need, eg.:I want to craft 1024 planks but it makes 1028 (not a big difference but I want to make it perfect
set(drop,$$[Dropping]);
set(#db,$$[Amount]);
if(%#db%>999);
#quotient = (%#db%)/999;
#rest = %#db%-(%#quotient%*999);
do(%#quotient%);
craftandwait($$i,999,%drop%);
loop;
craftandwait($$i,%#rest%,%drop%);
//If you craft less than 1000 item.
else;
craftandwait($$i,%#db%,%drop%);
endif;
Some web APIs that I build.
Example: http://api.mcme.co/s/user/meggawatts/pretty
Yes it would, actually, it only needs to fire once every tick
Instead of Do();Loop.., use Toggle(flag);Do();while(flag), for example
The usual thing people recommend is Toggle(flag);IF(flag);<macro>;ELSE;Stop();ENDIF, which will stop it a bit quicker
Macros doesn't support floating point numbers or objects though...
Also, i'm not sure if HTTP requests are even possible from within the game
Might be possible to add but seems like quite a bit of work for something few people would understand how to use (and those who did could potentially write a module to do that?)
'Cause tomorrow spring is here
xaero_ has created a module for this, but it seems he hasn't updated to the last version.
Link
Macro/Keybind mod Wiki
Also Could you replace text from inchat to a diffrent text?
For example:
How are you
to
Something else
For example:
How are you
to
Something else
Could you give me an example of a script that would automine?