Attendance Registration

Originally written by ImSaSuKi on the old forum. I’m not sure if he’s still around, so I’ve been updating it each time Joymax enables the attendance event.

Remember to remove it after the event is over!

from phBot import *
from threading import Timer
from time import gmtime, strftime
import QtBind, struct

YEAR = 23
START_MONTH = 7
END_MONTH = 8

# Initializing GUI
gui = QtBind.init(__name__,"xAutoAttendant")
lblNpcs = QtBind.createLabel(gui,"- Obtain coupon through log-in everyday & Rewards according to how many days you log-in the game",21,11)
btnAttendance = QtBind.createButton(gui,'btnAttendance_clicked',"   Attendance Check   ",600,33)
btnCoupon = QtBind.createButton(gui,'btnCoupon_clicked',"   Subscription Card (Continuity)   ",21,33)
btnTicket = QtBind.createButton(gui,'btnTicket_clicked',"   Chamber of Vicious Shadows Entrance Ticket (Acumulation)   ",21,55)
btnMagicP = QtBind.createButton(gui,'btnMagicP_clicked',"   New Premium Magic POP Card (Acumulation)   ",21,77)
btnRClock = QtBind.createButton(gui,'btnRClock_clicked',"   Revival Clock (7days) (Acumulation)   ",21,99)
btnPGoldt = QtBind.createButton(gui,'btnPGoldt_clicked',"   Premium Gold Time Plus (7days) (Acumulation)   ",21,121)

isConnected = False
log('Plugins: xAutoAttendant Plugin Succesfully loaded ~ by ProjeXNET [Auguest 2016]')

# Called when the bot successfully connects to the game server
def connected():
	global isConnected
	isConnected = False

# Called when the character enters the game world
def joined_game():
	locale = get_locale()
	if locale == 18 or locale == 65 or locale == 52 or locale == 56:
		global isConnected
		isConnected = True
		check_attendance()
	
# All packets received from Silkroad will be passed to this function
# Returning True will keep the packet and False will not forward it to the game server
def handle_joymax(opcode, data):
	if opcode == 0xB4DD:
		if data[0] == 0x02 and data[1] == 0x01:
			log("Event: Attendance check completed ~ xAutoAttendant Plugin")
	if opcode == 0xB034:
		if data[0] == 0x01 and data[1] == 0x0E: #Flag & Event
			#Reading reward
			log("Event: Reward obtained ["+get_item(struct.unpack_from("<i",data,8)[0])['name']+"]")
	return True

# Try to check the Attendance Event
def check_attendance():
	global YEAR, START_MONTH, END_MONTH
	dateNow = gmtime()
	# Checking maxim date of event
	year = int(strftime("%y",dateNow))
	month = int(strftime("%m",dateNow))
	if year == YEAR and (month >= START_MONTH and month <= END_MONTH):
		log("Event: Checking Attendance event ~ xAutoAttendant Plugin")
		Packet = bytearray()
		Packet.append(0x01)
		# Open attendance (return data for assistance check)
		Timer(10.0, inject_joymax,(0x74DD,Packet,False)).start()
		Packet = bytearray()
		Packet.append(0x02)
		# Try to check day
		Timer(15.0, inject_joymax,(0x74DD,Packet,False)).start()
		# Start timer for try to check in 6 hours
		Timer(21600.0,check_attendance).start()

def btnAttendance_clicked():
	if isConnected:
		check_attendance()

def btnCoupon_clicked():
	if isConnected:
		Packet = bytearray()
		Packet.append(0x04) # Selecting
		Packet = Packet + struct.pack('<i', 1) # Add reward ID
		inject_joymax(0x74DD,Packet,False)
		Packet = bytearray()
		Packet.append(0x05) # Getting reward
		Packet = Packet + struct.pack('<i', 1) # Add reward ID
		Packet = Packet + struct.pack('<i', 1) # Maybe is the quantity
		Timer(2.5, inject_joymax,(0x74DD,Packet,False)).start()
	
def btnTicket_clicked():
	if isConnected:
		Packet = bytearray()
		Packet.append(0x04)
		Packet = Packet + struct.pack('<i', 2)
		inject_joymax(0x74DD,Packet,False)
		Packet = bytearray()
		Packet.append(0x05)
		Packet = Packet + struct.pack('<i', 2)
		Packet = Packet + struct.pack('<i', 1)
		Timer(2.5, inject_joymax,(0x74DD,Packet,False)).start()

def btnMagicP_clicked():
	if isConnected:
		Packet = bytearray()
		Packet.append(0x04)
		Packet = Packet + struct.pack('<i', 3)
		inject_joymax(0x74DD,Packet,False)
		Packet = bytearray()
		Packet.append(0x05)
		Packet = Packet + struct.pack('<i', 3)
		Packet = Packet + struct.pack('<i', 1)
		Timer(2.5, inject_joymax,(0x74DD,Packet,False)).start()

def btnRClock_clicked():
	if isConnected:
		Packet = bytearray()
		Packet.append(0x04)
		Packet = Packet + struct.pack('<i', 4)
		inject_joymax(0x74DD,Packet,False)
		Packet = bytearray()
		Packet.append(0x05)
		Packet = Packet + struct.pack('<i', 4)
		Packet = Packet + struct.pack('<i', 1)
		Timer(2.5, inject_joymax,(0x74DD,Packet,False)).start()

def btnPGoldt_clicked():
	if isConnected:
		Packet = bytearray()
		Packet.append(0x04)
		Packet = Packet + struct.pack('<i', 5)
		inject_joymax(0x74DD,Packet,False)
		Packet = bytearray()
		Packet.append(0x05)
		Packet = Packet + struct.pack('<i', 5)
		Packet = Packet + struct.pack('<i', 1)
		Timer(2.5, inject_joymax,(0x74DD,Packet,False)).start()
3 Likes

Does how this work change between different servers?

It should. You have to change the year and start / end month to get it working.

I updated that I’ll check back in tomorrow.
Edit: Will it tell you if you already checked in?

1 Like

Couldn’t login for a couple days (babel was down)

I updated it still doesn’t seem to work

It was originally for iSRO/SilkroadR and cSROR so it may not work on vSRO. You did update the date in it, right?

YEAR = 20
START_MONTH = 4
END_MONTH = 5
This is what i have it set to might not work because of that.

Does it work at trsro?

@Ryan it work at trsro?

Yes it works. Thanks @Ryan
Video link ; OTOMATİK GÜNLÜK GİRİŞ ETKİNLİĞİ | TRSRO - YouTube

Turkish ;
Evet, Çalışıyor. Teşekkürler @Ryan
Video link ; OTOMATİK GÜNLÜK GİRİŞ ETKİNLİĞİ | TRSRO - YouTube

Attendance Check work fine. but its not get event rewards automatically I have to press Subscription Card manual to get the reward so I suggest if you can add the Subscription Card as a command script in order to get reward automatically <3

should I relog everyday to make the auto check? cause in isro is like 9 hour queue average

from phBot import *
from threading import Timer
from time import gmtime, strftime
import QtBind, struct

YEAR = 23
START_MONTH = 7
END_MONTH = 8

# Initializing GUI
gui = QtBind.init(__name__,"xAutoAttendant")
lblNpcs = QtBind.createLabel(gui,"- Obtain coupon through log-in everyday & Rewards according to how many days you log-in the game Update 2023 by CaniBala",21,11)
btnAttendance = QtBind.createButton(gui,'btnAttendance_clicked',"   Attendance Check   ",600,33)
btnCoupon = QtBind.createButton(gui,'btnCoupon_clicked',"   Exp Booster 100% (Continuity)   ",21,33)
btnTicket = QtBind.createButton(gui,'btnTicket_clicked',"   Chamber of Vicious Shadows Entrance Ticket (Acumulation)   ",21,55)
btnMagicP = QtBind.createButton(gui,'btnMagicP_clicked',"   New Premium Magic POP Card (Acumulation)   ",21,77)
btnRClock = QtBind.createButton(gui,'btnRClock_clicked',"   Revival Clock (7days) (Acumulation)   ",21,99)
btnPGoldt = QtBind.createButton(gui,'btnPGoldt_clicked',"   Premium Gold Time Plus (7days) (Acumulation)   ",21,121)

isConnected = False
log('Plugins: xAutoAttendant Plugin Succesfully loaded ~ by ProjeXNET [Auguest 2016] ~ Update 2023 by CaniBala')

# Called when the bot successfully connects to the game server
def connected():
	global isConnected
	isConnected = False

# Called when the character enters the game world
def joined_game():
	locale = get_locale()
	if locale == 18 or locale == 65 or locale == 52 or locale == 56:
		global isConnected
		isConnected = True
		check_attendance()
	
# All packets received from Silkroad will be passed to this function
# Returning True will keep the packet and False will not forward it to the game server
def handle_joymax(opcode, data):
	if opcode == 0xB4DD:
		if data[0] == 0x02 and data[1] == 0x01:
			log("Event: Attendance check completed ~ xAutoAttendant Plugin")
	if opcode == 0xB034:
		if data[0] == 0x01 and data[1] == 0x0E: #Flag & Event
			#Reading reward
			log("Event: Reward obtained ["+get_item(struct.unpack_from("<i",data,8)[0])['name']+"]")
	return True

# Try to check the Attendance Event
def check_attendance():
	global YEAR, START_MONTH, END_MONTH
	dateNow = gmtime()
	# Checking maxim date of event
	year = int(strftime("%y",dateNow))
	month = int(strftime("%m",dateNow))
	if year == YEAR and (month >= START_MONTH and month <= END_MONTH):
		log("Event: Tentando recompensa diaria ~ xAutoAttendant Plugin")
		Timer(15.0,btnCoupon_clicked).start()
		log("Event: Checking Attendance event ~ xAutoAttendant Plugin")
		Packet = bytearray()
		Packet.append(0x01)
		# Open attendance (return data for assistance check)
		Timer(10.0, inject_joymax,(0x74DD,Packet,False)).start()
		Packet = bytearray()
		Packet.append(0x02)
		# Try to check day
		Timer(15.0, inject_joymax,(0x74DD,Packet,False)).start()
		# Start timer for try to check in 6 hours
		Timer(21600.0,check_attendance).start()

def btnAttendance_clicked():
	if isConnected:
		check_attendance()

def btnCoupon_clicked():
	if isConnected:
		Packet = bytearray()
		Packet.append(0x04) # Selecting
		Packet = Packet + struct.pack('<i', 1) # Add reward ID
		inject_joymax(0x74DD,Packet,False)
		Packet = bytearray()
		Packet.append(0x05) # Getting reward
		Packet = Packet + struct.pack('<i', 1) # Add reward ID
		Packet = Packet + struct.pack('<i', 1) # Maybe is the quantity
		Timer(2.5, inject_joymax,(0x74DD,Packet,False)).start()
	
def btnTicket_clicked():
	if isConnected:
		Packet = bytearray()
		Packet.append(0x04)
		Packet = Packet + struct.pack('<i', 2)
		inject_joymax(0x74DD,Packet,False)
		Packet = bytearray()
		Packet.append(0x05)
		Packet = Packet + struct.pack('<i', 2)
		Packet = Packet + struct.pack('<i', 1)
		Timer(2.5, inject_joymax,(0x74DD,Packet,False)).start()

def btnMagicP_clicked():
	if isConnected:
		Packet = bytearray()
		Packet.append(0x04)
		Packet = Packet + struct.pack('<i', 3)
		inject_joymax(0x74DD,Packet,False)
		Packet = bytearray()
		Packet.append(0x05)
		Packet = Packet + struct.pack('<i', 3)
		Packet = Packet + struct.pack('<i', 1)
		Timer(2.5, inject_joymax,(0x74DD,Packet,False)).start()

def btnRClock_clicked():
	if isConnected:
		Packet = bytearray()
		Packet.append(0x04)
		Packet = Packet + struct.pack('<i', 4)
		inject_joymax(0x74DD,Packet,False)
		Packet = bytearray()
		Packet.append(0x05)
		Packet = Packet + struct.pack('<i', 4)
		Packet = Packet + struct.pack('<i', 1)
		Timer(2.5, inject_joymax,(0x74DD,Packet,False)).start()

def btnPGoldt_clicked():
	if isConnected:
		Packet = bytearray()
		Packet.append(0x04)
		Packet = Packet + struct.pack('<i', 5)
		inject_joymax(0x74DD,Packet,False)
		Packet = bytearray()
		Packet.append(0x05)
		Packet = Packet + struct.pack('<i', 5)
		Packet = Packet + struct.pack('<i', 1)
		Timer(2.5, inject_joymax,(0x74DD,Packet,False)).start()

I didn’t improve the original code, I just set it to receive the daily reward automatically when logging in.

1 Like

This plugin is not working.

Doesn’t work or you don’t know how to use it? It’s working for everyone.

1 Like

works but only if the char is going online it will check… a manual check didnt worked since yet… but doesnt matter for me… Its just working Perfect thanks