Jump to content

Question

3 answers to this question

Recommended Posts

Posted

I'm assuming you mean in an automated fashion (otherwise it's very simple XD). To do so, you have to use an SQL item_db2 (or have it imported, at the very least). You can then have a script pull all the items from it.

Here's an example script - simply send a whisper to "syncshop" on an admin account to refresh your shop with any changes in item_db2.

prontera,150,150,0	shop	Example Shop	83,512:-1
	
-	script	syncshop	-1,{
OnWhisperGlobal:
	if (getgmlevel() < 99) end;
	dispbottom "Syncing your shop, please wait.";
	detachrid;
OnInit:
	npcshopitem "Example Shop",512,15;
	npcshopdelitem "Example Shop",512;
	set .@count, query_sql("SELECT `id`,`price_buy` FROM `item_db2`",.@id,.@price);
	for(set .@i,0; .@i<.@count; set .@i,.@i+1)
		npcshopadditem "Example Shop",.@id[.@i],.@price[.@i];
	end;
}
Posted

I'm assuming you mean in an automated fashion (otherwise it's very simple XD). To do so, you have to use an SQL item_db2 (or have it imported, at the very least). You can then have a script pull all the items from it.

Here's an example script - simply send a whisper to "syncshop" on an admin account to refresh your shop with any changes in item_db2.

prontera,150,150,0	shop	Example Shop	83,512:-1
	
-	script	syncshop	-1,{
OnWhisperGlobal:
	if (getgmlevel() < 99) end;
	dispbottom "Syncing your shop, please wait.";
	detachrid;
OnInit:
	npcshopitem "Example Shop",512,15;
	npcshopdelitem "Example Shop",512;
	set .@count, query_sql("SELECT `id`,`price_buy` FROM `item_db2`",.@id,.@price);
	for(set .@i,0; .@i<.@count; set .@i,.@i+1)
		npcshopadditem "Example Shop",.@id[.@i],.@price[.@i];
	end;
}
Ive never thought to do this before, neat.
Posted

I'm assuming you mean in an automated fashion (otherwise it's very simple XD). To do so, you have to use an SQL item_db2 (or have it imported, at the very least). You can then have a script pull all the items from it.

Here's an example script - simply send a whisper to "syncshop" on an admin account to refresh your shop with any changes in item_db2.

prontera,150,150,0	shop	Example Shop	83,512:-1
	
-	script	syncshop	-1,{
OnWhisperGlobal:
	if (getgmlevel() < 99) end;
	dispbottom "Syncing your shop, please wait.";
	detachrid;
OnInit:
	npcshopitem "Example Shop",512,15;
	npcshopdelitem "Example Shop",512;
	set .@count, query_sql("SELECT `id`,`price_buy` FROM `item_db2`",.@id,.@price);
	for(set .@i,0; .@i<.@count; set .@i,.@i+1)
		npcshopadditem "Example Shop",.@id[.@i],.@price[.@i];
	end;
}

I'm sorry i didnt understand this xD where will i put this script? nad how would i send a whisper to it? thank you :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...