Guild icon
Teeworlds
IRC / bridge
One-way IRC channel bridge. If you want to be able to send messages to IRC, contact @Dune or @heinrich5991. https://www.teeworlds.com/?page=docs&wiki=rules/irc_rules
Between 2020-03-31 00:00:00Z and 2020-04-01 00:00:00Z
Avatar
[quakenet] richrd BOT 2020-03-31 12:17:29Z
anyone got any material on how the client-server protocol works?I
12:18
I'm looking at creating a script that connects as spectator, and runs rcon commands and reads their output.
12:18
I
Avatar
I think @ChillerDragon wrote bots like that
Avatar
[quakenet] richrd BOT 2020-03-31 12:19:06Z
Trying to run rcon commands programmatically
Avatar
You know about econ?
Avatar
[quakenet] richrd BOT 2020-03-31 12:19:34Z
I don't feel like copying the entire client code to do that
12:19
No never heard
Avatar
[MISC] Accessing the external console / econ (Page 1) — Tutorials — Teeworlds Forum — Everything Teeworlds!
12:19
external console
12:20
(this way you don't even need to take a spectator slot)
Avatar
[quakenet] richrd BOT 2020-03-31 12:20:17Z
DOPE!
Avatar
I think @jxsl13 also made some Teeworlds econ bots
Avatar
[quakenet] richrd BOT 2020-03-31 12:20:33Z
Can I run any command I want with it?
Avatar
Any rcon command, yes
12:20
It's basically an alternative way to log in
Avatar
[quakenet] richrd BOT 2020-03-31 12:21:07Z
ahoy, cheers for that! solves my problems basically
Avatar
=) glad to hear
Avatar
[quakenet] richrd BOT 2020-03-31 12:23:44Z
we have a tradition at work, where at 13:00 we have a "coffee break" which means we play TW for 30 minutes against each other
12:24
yesterday we leveled up our game by having voice chat in discord for both red and blue teams. now we want to auto assign players and get some stats from the game
Avatar
Sounds good
Avatar
ChillerDragon 2020-03-31 12:27:58Z
for stats also using econ you can also slap that on any vanilla server https://github.com/chillavanilla/TeeworldsEconMod
12:28
check it out on 149.202.127.134:8704 and type in /cmdlist in chat
Avatar
[quakenet] richrd BOT 2020-03-31 12:31:11Z
starred, will check out 👍 cheers!
Avatar
ChillerDragon 2020-03-31 12:32:19Z
do u also use github stars as "watch later" ? 😄
Avatar
[quakenet] richrd BOT 2020-03-31 12:33:04Z
yes, but usually only if I already know it will be of value to me :)
Avatar
ChillerDragon 2020-03-31 12:33:08Z
i really wish github would add some actual watch later feature separate from stars
Avatar
[quakenet] richrd BOT 2020-03-31 12:33:30Z
yeah that would help
12:39
btw I'm wavi on TW
12:39
can I send commands with telnet?
12:39
to econ?
Avatar
ChillerDragon 2020-03-31 12:45:58Z
yes
12:46
you can use netcat or telnet to literally auth as admin and have a full functional admin console
12:46
similar to the one ingame
Avatar
[quakenet] richrd BOT 2020-03-31 12:47:09Z
I connected via telnet on unix, I can see all the logs coming in but sending stuff does nothing 🤔
12:48
if I use TeeworldsEconMod do I need to run it on the same server where my tw server is?
Avatar
ChillerDragon 2020-03-31 12:50:51Z
yes it connects to localhost
Avatar
[quakenet] richrd BOT 2020-03-31 12:51:12Z
gotcha
12:51
can be edited here tho
Avatar
[quakenet] richrd BOT 2020-03-31 12:54:50Z
does it need access to the logfiles though?
Avatar
ChillerDragon 2020-03-31 12:56:04Z
nah no logfiles needed
12:56
it reads from stdout of the server
12:57
the logfiles are used for some optional logging on discord
Avatar
[quakenet] richrd BOT 2020-03-31 13:05:03Z
why not read the output of the econ?
13:05
but in any case cool project, thanks for sharing!
Avatar
ChillerDragon 2020-03-31 13:09:18Z
oh yea my project is a mess and @jxsl13 work shows that it is possible to work way cleaner with just python but i created some crazy shell pipes to achieve that
13:09
was the easiest for me and it is working fine in production since years
Avatar
I stopped using python :D as the deployment is annoying, switched to Go.
13:11
compiled binaries ftw.
Avatar
[quakenet] Learath2 BOT 2020-03-31 13:13:01Z
@LordSk 🦋 shouldn't we be clipping instead of using a fake button?
Avatar
Hum we could
13:14
I like it that way because it is very clear what's happening
Avatar
[quakenet] Learath2 BOT 2020-03-31 13:22:03Z
(the fake button doesn't seem to be working btw
Avatar
Yeah you can drag layers right?
Avatar
[quakenet] Learath2 BOT 2020-03-31 13:22:25Z
I mean you can't click it sure, but hover effects still happen
Avatar
Anything that is not tied to an ID will work
13:23
It is still a work in progress
13:23
I'm not sure what the right solution is just yet
Avatar
[quakenet] Learath2 BOT 2020-03-31 13:27:07Z
problem with clipping is that only the render popup function knows the size of the popup
13:27
(I was going to do it but I couldn't figure out a nice way either)
Avatar
[quakenet] Dune BOT 2020-03-31 14:37:04Z
that was fast, Learath2
14:37
If you don't like it this way I could also code a more general PopupModal which can be configured to render anything. Lambdas would be perfect to clean this up...
Avatar
[quakenet] Learath2 BOT 2020-03-31 14:37:45Z
Oh, forgot that yea
14:39
Dune: apparently they weren't localized on the old editor and I'm not sure how to add new strings nowadays
Avatar
[quakenet] Dune BOT 2020-03-31 14:39:32Z
I think the new editor localizes this stuff
14:39
how to add new strings -> I mean Localize("...") and you're done
Avatar
just use Localize, done
Avatar
[quakenet] richrd BOT 2020-03-31 18:13:27Z
ChillerDragon how do you parse the TW logs?
18:14
I see the server log has no escaping or anything. I changed my name to include spaces and single quotes and this is how the server log looks like [game]: team_join player='1:wa' vi k' team=0
18:14
how am I supposed to get the player id and nick from that 🤔
Avatar
ChillerDragon 2020-03-31 18:16:32Z
oh i parse them poorly with my python crack code
18:17
didnt notice any parsing errors yet tho
Avatar
[quakenet] richrd BOT 2020-03-31 18:17:24Z
"crack code" :D nice
Avatar
ChillerDragon 2020-03-31 18:17:52Z
what r u interested in team_join ?
18:17
lemme get the code
Avatar
[quakenet] richrd BOT 2020-03-31 18:18:17Z
I kind of wanna parse everything, and write a bi-directiona python interface for teeworls
Avatar
ChillerDragon 2020-03-31 18:18:27Z
string.find and string.rfind is my friend
18:18
i barley use regex cuz python regex is always too much brain for me
Avatar
[quakenet] richrd BOT 2020-03-31 18:18:52Z
you have "player is on a killing spree" messages on your server, are they done with TeeworlsEconMod ?
Avatar
ChillerDragon 2020-03-31 18:18:57Z
yes
Avatar
[quakenet] richrd BOT 2020-03-31 18:19:12Z
that's pretty sweet
Avatar
ChillerDragon 2020-03-31 18:19:36Z
there are some known issues and limitations
18:20
i for example have one server in 0.6 and one in 0.7 and i use the same sqlite3 database and i got a blocking error once cuz both tried to access the db
18:20
i think most utf8 and unicode madness errors are solved nowerdays
18:20
but this was a issue for a long time
18:21
and if you start parsing be aware that not every connection message is followed by a disconnect message. There might be disconnects without connections in the log if the client gets kicked during connection phase etc.
Avatar
[quakenet] richrd BOT 2020-03-31 18:25:40Z
phew
Avatar
ChillerDragon 2020-03-31 18:27:49Z
but those are rare so if the first 100 hours testing worked doesnt mean its stable :p
Avatar
[quakenet] richrd BOT 2020-03-31 18:31:52Z
what does cbase.cfind do?
18:38
i'm on this chat at Quakenet as well as Freenode, where's the official chat?
Avatar
[quakenet] heinrich5991 BOT 2020-03-31 18:41:13Z
quakenet
Avatar
[quakenet] richrd BOT 2020-03-31 18:42:01Z
where are the messages from [bridge] coming from?
18:42
discord?
Avatar
[quakenet] heinrich5991 BOT 2020-03-31 18:43:29Z
yes
18:43
Invite to join a server
Guild icon
announcements
19:13
all you need to know is regex and how capture expressions work, basically everything within parenthesis in your regex can be extracted individually.
Avatar
ChillerDragon 2020-03-31 19:25:30Z
yea i know regex i like to use it in bash
19:25
but im usually too lazy to look up py syntax
Avatar
it's the same, just with some ugly extensions, that make the usage more convenient :D
19:29
macOS -> Dash app
19:30
macOS -> Alfred
19:30
best combination
Avatar
[quakenet] richrd BOT 2020-03-31 19:42:37Z
ChillerDragon I cant figure out how you track player names.. I just named myself player='99:hax' and your mod correctly recognizes me and doesn't get confused
19:43
do you store the player name on connect and then rely on just the player id for all other events?
19:44
the server sends lines like this [game]: pickup player='0:wa' vi' item=1 (payer name there is "wa' vi") but the single quotes aren't escaped :<
19:49
when a player joins the first line in the logs with their name is "[game]: team_join player='0:playername' team=0". If i can assume the player id and name is between the first and last single quote I can store the player details and later just match the player based on the id (i think)
Avatar
ChillerDragon 2020-03-31 21:12:33Z
yea about the single quotes i do a string find of "player='" and "' item=" and match everything in between no matter if there are quotes
21:13
and also your assumption is correct
21:13
keep in mind not to use a fixed offset of two from the first quote because ids can be 2 digits i think
21:14
i do not know exactly it changed in 0.6 and 0.7 and sometimes they were even hex
21:14
so do tests with higher ids
21:15
I used to do everything name based but I think i moved some things to id based especially since 0.7 supports duplicated names
Avatar
What about improving the server side bot? It is a great idea to keep it joined when the server is empty and for balancing purposes, but it's bit too dumb, it keeps falling down all the way around.
Avatar
@1stDecadeTW ask @nheir /rand
21:25
he's doing that kinda?
Avatar
[quakenet] Dune BOT 2020-03-31 21:25:48Z
probably not, since the time
21:25
but it's an open issue :)
Avatar
@richrd a nickname cannot change as of 0.7 after you connect to the server
21:27
it stays the same until you reconnect, at least server side
Avatar
[quakenet] richrd BOT 2020-03-31 21:28:55Z
thanks for the pointers! really helps, since I'm just starting out
21:29
i started matching stuff partly manually and partly with regex and seems promising for now...
Avatar
regex does work perfectly fine, I'm also using it in my discord econ bot
Avatar
nheir/rand bots are one of the best bots right now, but they are too strong, they all behave the same, they don't have any strategies as humans in-game, just "get flag, kill and destroy", so it makes it boring after a while
Avatar
[quakenet] richrd BOT 2020-03-31 21:30:07Z
seems that the regex approach handles the quote issue properly
Avatar
I would add $ at the end of some of those regex, as sometimes people might use quotes as nickname
21:31
to match the end of the line
Avatar
[quakenet] wavi BOT 2020-03-31 21:32:02Z
I'm doingstuff like: player='(\d{1,2}):(.*)'
21:32
its greedy and gets the quotes within the nickname
Avatar
does it get mmultiple quotes as well :o?
Avatar
[quakenet] wavi BOT 2020-03-31 21:34:39Z
yeah, even though it surprises me quite a bit
21:34
for this log line: [game]: team_join player='0:' team=9' team=0
Avatar
inrteresting 😮
Avatar
[quakenet] wavi BOT 2020-03-31 21:34:55Z
i get: ('0', "' team=9", '0')
21:35
i tried to confuse it by settimg my nick to: ' team=9
Avatar
set your nick to player='5:a'
21:36
x)
Avatar
[quakenet] wavi BOT 2020-03-31 21:38:29Z
still works 😮
21:38
DATA: [game]: team_join player='1:player='5:a'' team=1
21:38
MATCHED: ('1', "player='5:a'", '1')
Avatar
then it seems fine 😮
Avatar
[quakenet] wavi BOT 2020-03-31 21:40:32Z
kind of blows my mind but I guess i'll just hope this will always work
23:07
the heck is this pyramide of doom
Exported 148 message(s)