people playing: 100, servers online: 28, games played: 144,602,856 Top Player: Cicada3301

  Toribash Community » Toribash » Mods » Third party
Register FAQ General Rules Community
Thread Tools Display Modes
Old Jun 30, 2018   #1
4th Dan Black Belt
Join Date: May 2016
Posts: 0

[WIP] Bet Server Hosting Bot
Hi, very early WIP of a bot to (help) host a betting server.

Run in Python 3.6.x. Install the modules required through pip, I explained it in one of my other threads.

Right now all it does is join a server and record the chat, I'm gonna be updating this thread as I go along so please report any bugs if you find them.

python code:

import socket
import hashlib
import time
import threading

while 1:
port = input("Enter room port: ")
port = int(port)

un = input("Enter username: ")
pw = input("Enter password: ")

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

s.connect(("", port))
print("\nFailed to connect, are you sure you wrote the port correctly?")

pw = hashlib.md5(str(pw).encode()).hexdigest()
data = "mlogin "+str(un) + " " + str(pw) +" 0 0\n"

print("\nConnecting: " + data)



print("Starting to ping the server...\n")

def ping_server():
ping = threading.Timer(15.0, ping_server)

ping = threading.Timer(15.0, ping_server)

data_last = 0
user_nudges = {}
nudgeline = 1

while 1:

data = s.recv(1024)
if not data.decode() == data_last:
if data.decode().startswith("SAY"):
if "<^" in data.decode():
chat_user = str(data.decode()[data.decode().find("<")+4:data.decode().find(">")-3])
chat_msg = str(data.decode()[data.decode().find(">")+2:][:-1])
if not chat_user == un:

print(chat_user, "said", chat_msg)

if chat_msg == "!usenudge":
if chat_user in user_nudges:
print("! Nudged", chat_user, "to", str(nudgeline))
s.send(b"NUDGE", chat_user, str(nudgeline)+"\n")
print("! Did not nudge", chat_user + ": no nudges")
#if chat_msg.startswith("!givenudge "):
#if chat_user in user_nudges:

# else:

data_last = data.decode()
data = ""

Last edited by Surge_old2; Jun 30, 2018 at 09:52 PM..
Surge_old2 is offline   Reply With Quote
Old Jun 30, 2018   #2
Senior Member
Zelda Main Belt
Join Date: Jul 2014
Posts: 1,448

Can you help provide me with a download for Python, I do not know where to download it tbh, I can never get Python code to work with me, I could pm with you on Discord if you would like to help.
Psychology, the way to win Toribash games.
MrMiyagy is offline   Reply With Quote
Old Jun 30, 2018   #3
4th Dan Black Belt
Join Date: May 2016
Posts: 0

Discord is best. NKLI#7204
Surge_old2 is offline   Reply With Quote

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 12:05 AM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
ragdoll fighting game physics fighting game ragdoll fighting physics funmotion joints martial arts karate pc mac free game turn based game