automatic @at after creating a vending shop

Lord Ganja

New member
Messages
161
Points
0
Age
34
Location
Ganja World
Is it possible for players to automatically use @autotrade command right after clicking the 'OK' button when vending?

Check this image for further explanation.

img1.png

img2.png

Thanks in advance!

 
@vending.c

safestrncpy(sd->message, message, MESSAGE_SIZE);clif->openvending(sd,sd->bl.id,sd->vending);clif->showvendingboard(&sd->bl,message,0);+atcommand->exec(sd->fd, sd, "@autotrade", true);idb_put(vending->db, sd->status.char_id, sd);} 
default_ani_meow.gif


 
Is it possible for players to automatically use @autotrade command right after clicking the 'OK' button when vending?

Check this image for further explanation.

attachicon.gif
img1.png

attachicon.gif
img2.png

Thanks in advance!
Its a good IDEA, just make it sure that u will not make a mistake in pricing after clicking the OK button or else u dont have time anymore in re checking it.. 

 
@vending.c

safestrncpy(sd->message, message, MESSAGE_SIZE);clif->openvending(sd,sd->bl.id,sd->vending);clif->showvendingboard(&sd->bl,message,0);+atcommand->exec(sd->fd, sd, "@autotrade", true);idb_put(vending->db, sd->status.char_id, sd);} 
default_ani_meow.gif
Thank you @@malufett. it's working!
default_smile.png


btw as @@karazu mentioned,

Its a good IDEA, just make it sure that u will not make a mistake in pricing after clicking the OK button or else u dont have time anymore in re checking it.. 

can you make it like trigger a script so we could add a timer before it use @autotrade?

clif->showvendingboard(&sd->bl,message,0);+atcommand->exec(sd->fd, sd, "@autotrade", true); // CHANGE THIS ONE TO A CODE THAT WILL TRIGGER A SCRIPTidb_put(vending->db, sd->status.char_id, sd);

the script is like:

Code:
-	script	auto_autotrade	-1,{attachnpctimer ""+strcharinfo(0)+"";initnpctimer;// Added this so the vendor will have 10 seconds to recheck the vended items before it goes to autotrade modeOnTimer10000;	atcommand "@autotrade";	end; }
 
nah..you don't need that you can set it at 'conf/battle/misc.conf'

// Set this to the amount of minutes autotrade chars will be kicked from the server.at_timeout: 0
default_ani_meow.gif


 
nah..you don't need that you can set it at 'conf/battle/misc.conf'

// Set this to the amount of minutes autotrade chars will be kicked from the server.at_timeout: 0
default_ani_meow.gif
Oh, I mean, like the script will be triggered before it enters autotrade mode..

at_timeout works like, vendors which are already in autotrade mode will be kicked from server.

 
you can use 'bindatcmd'

default_ani_meow.gif
Damn. Yeah. Haven't think of that 
default_hmm.gif


anyway last question, what do I have to change with atcommand->exec to trigger the bindatcmd?

I use this:

OnInit:

     bindatcmd("vendcheck","vend_check::OnVendCheck",100,100);

but when atcommand->exec(sd->fd, sd, "@vendcheck", true); is triggered, it says "@vendcheck is Unknown Command."

 
Back
Top