Auto donate Guild Points (GP)

in TRSro you can donate 50 gp’s as you collected

Can you make this automatic @Ryan?

Thanks for your consideration,

Ahmet.

You could build some condition to trigger python like:

import phBot
import struct

# Check if has SP to donate to the guild
def DonateGP(quantity=None):
	# If quantity it's not specified, donate all the SP
	if quantity == None:
		quantity = phBot.get_character_data()['sp']
		if quantity == 0:
			return

	# GUILD_SP_DONATE_REQUEST
	phBot.inject_joymax(0x7258,struct.pack('I', quantity),False)

# Donate by using conditions
def DonateGP_All():
	DonateGP()

# Donate by using conditions
def DonateGP_100():
	DonateGP(100)

if ( ... ) { Python ( DonateGP_All ); }

3 Likes

Thank you very much. However I don’t actually know how to inject this code to phbot. Can you please briefly enlight me?

Regards

Ahmet

Copy and paste the code to some text file and rename it with .py extension.
Then drop it to the Plugins folder from phBot and restart it to build the condition.

You’ll need to have installed python from phBot installer.

What do we write in the value of python in the if section?

Are we writing the name of the function? If so, how do we give the parameters?

I have done so, however the bot couldn’t load the plugin I don’t know why.
image
image

@ddkorkut you have to trigger it by condition as jelly say like this
if sp >1000 then python DonateGP_100

but to be clear i have no exp with trigering python with condition
but you can try it

its not a plugin

It is a plugin… there’s just no UI so you won’t see it load.

Thanks for your reply, do you know where I can type if statement to trigger it?

Regards

Condition Tab -> Builder

you can also search -----> Conditions

Ah I guess there has been a misunderstanding. We don’t donate sp in TrSro, we donate gp, which increases as you level up. But I’ll try to modify your code. Hope I could do it

Could you find a solution for gp donation?

Selam dedekorkut trsro özelinde oto gp bağışa bir çözüm buldun mu?

yok hocam olmuyor. Sp bağışlamayı ayarlamışlar, gp değil.

1 Like