def bomb(self, mobile, delay, count): if mobile and delay and count: try: print("Mobile: " + mobile + "\nDelay: " + delay + "\nSpam count: " + count) Spammer(mobile, delay, count).spam() except Exception as e: print(str(e))
def create_users(self, num_users, error_rate_max_yes, error_rate_max_no): users = list() spammer1 = Spammer("spammer1") spammer2 = Spammer("spammer2") hammer1 = User(0.0, 0.0, "hammer1") hammer2 = User(0.0, 0.0, "hammer2") users.append(spammer1) users.append(spammer2) users.append(hammer1) users.append(hammer2) if os.path.isfile(self._users_path): with open(self._users_path, "r") as users_file: users_dict = json.load(users_file) for user in users_dict: error_rate_yes = users_dict[user]["error_rate_yes"] print("error_rate_yes: %s" % error_rate_yes) error_rate_no = users_dict[user]["error_rate_no"] print("error_rate_no: %s" % error_rate_no) us = User(error_rate_yes, error_rate_no, "user" + user) users.append(us) else: i = 0 users_dict = dict() for _ in range(num_users - len(users)): error_rate_yes = random.uniform(0.0, error_rate_max_yes) print("error_rate_yes: %s" % error_rate_yes) error_rate_no = random.uniform(0.0, error_rate_max_no) print("error_rate_no: %s" % error_rate_no) users_dict[i] = { "error_rate_yes": error_rate_yes, "error_rate_no": error_rate_no } user = User(error_rate_yes, error_rate_no, "user" + str(i)) users.append(user) i += 1 with open(self._users_path, "w") as users_file: json.dump(users_dict, users_file, indent=4, separators=(',', ': ')) random.shuffle(users) return users
def main(argv): delay = 5 text = "Sample" is_splitted = False count = 1 suffix = "\n" single_delay = 0 try: opts, args = getopt.getopt(argv, "hd:t:s:c:l", [ "delay=", "text=", "is-splitted=", "count=", "line-ending=", "single-delay=" ]) except getopt.GetoptError as err: print("Wrong format") sys.exit(2) for opt, arg in opts: if opt == '-h': print( "spammer -d <delay: seconds> -t <text_to_spam: string> -c <repetition_count: int> -s <is_text_splitted: boolean> -l <line_ending: string>" ) sys.exit() elif opt in ("-d", "--delay"): delay = float(arg) elif opt in ("-t", "--text"): text = arg elif opt in ("-s", "--is-splitted"): is_splitted = arg.lower()[0] == "t" elif opt in ("-c", "--count"): count = int(arg) elif opt in ("-l", "--line-ending"): suffix = arg elif opt == "--single-delay": single_delay = float(arg) spammer = Spammer(text=text, spamc=count, init_delay=delay, is_splitted=is_splitted, suffix=suffix) spammer.run()
def spamBody(stdscr): global buffer_file settings = Config() settings.loadConfig(buffer_file) sides = stdscr.getmaxyx() if settings.get("MODE") == 0: spam = Spammer(settings, start_settings) elif settings.get("MODE") == 1: spam = Stoner(settings, start_settings) spam.generate() length = spam.length() spam.begin() line = "Progress: 0/{}".format(length) while True: stdscr.clear() stdscr.addstr(int(sides[0] / 2), int(sides[1] / 2) - int(len(line) / 2), line, curses.color_pair(2)) iter = spam.step() line = "Progress: {0}/{1}".format(iter, length) if iter >= length and settings.get("MODE") == 0: return State.MAIN_MENU sleep(start_settings.get("SPAM_SPEED"))
elif 'snake water gun game' in query: a.speak( "Launching Snake Water Gun game on the console.......Dont cheat " ) snake_water_gun() elif 'guess the number game' in query: a.speak( "Launching guess the number game on the console......Dont cheat " ) guess_number() elif 'spam spam' in query: a.speak("Cheat code activated...Initiating spammer...") s = Spammer() s.main() elif 'repeat after me' in query: a.speak("Ok I am listening....") response = command().lower() a.speak(response) elif 'learn python' in query: a.speak("Opening Code With Harry's python playlist...") access_web( "https://www.youtube.com/playlist?list=PLu0W_9lII9agICnT8t4iYVSZ3eykIAOME" ) elif 'learn java' in query: a.speak("Opening Code With Harry's java playlist...")
from config import BASE_URL, DB_DB, DB_PSW, DB_USER, \ DB_HOST, SESSION_STRING, API_HASH, API_ID, TG_KEY from spammer import Spammer db = Database() app = Client(SESSION_STRING, api_hash=API_HASH, api_id=API_ID, bot_token=TG_KEY, parse_mode="markdown") db.bind(provider='mysql', host=DB_HOST, user=DB_USER, passwd=DB_PSW, db=DB_DB) eventi_nuovi = Spammer(app, db) eventi_nuovi.start() def add_user(user_id, name): try: with db_session: db.execute(f"INSERT IGNORE INTO bot_users(tg_id, tg_name) " f"VALUES('{user_id}', '{name}');") except Exception as e: print(e) def remove_user(user_id): try: with db_session:
from spammer import Spammer delay = input('Enter the delay: ') mobile = input('Enter the mobile number: ') count = input('Enter the number of blasts: ') Spammer(mobile, count, delay).redbus_blast()
import tkinter as tk from selenium import webdriver import threading from spammer import Spammer from school_class import Class driver = webdriver # Choose desired classes phs1101 = Class("PHS1101", True) mth2302d = Class("MTH2302D", True) ssh3201 = Class("SSH3201", False) class_list = {phs1101, mth2302d, ssh3201} thread = Spammer(driver, class_list) def threadTimer(thread): timer = threading.Timer(20, thread.join()) timer.start() window = tk.Tk() window.title('Automated Class Selector') window.geometry("400x400") b1 = tk.Button(window, text="Start", command=lambda: [thread.start(), threadTimer(thread)]) b1.pack() # b2 = tk.Button(window, text="Stop", # command=lambda: threadTest.join()) # b2.pack()