Jump to content
  • 0

Ideas on making this shop NPC Cleaner


Vach

Question


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   19
  • Joined:  09/27/12
  • Last Seen:  

Hey everyone. I wrote this shop script to merge all my weapon shops into one NPC and have that NPC make a dynamic menu that changes the color and order of the menu options based on your class.

However, due to my knowledge of arrays and NPC menu structure... the script became large for something so simple. So I wanted to post it here and see if anyone knew a way of simplifying this:

/* Dynamic Weapon Shop NPC
// Scripted by Vach
// ====================================
This script checks the players class and then opens a list of shops
with the higher shops on the list being applicable to their class.
Players can still access the other shops, to buy weapons for friends
or just look around.
// ======= LOG ========================
11/03/2012 - Script Creation
12/03/2012 - Fixed some errors and made the interface cleaner
*/
prt_in.gat,172,140,3 script Weapons Shop 951,{
// Reference material
//set .@ShopTag[1],"Daggers";
//set .@ShopTag[2],"Swords";
//set .@ShopTag[3],"Spears";
//set .@ShopTag[4],"Axes";
//set .@ShopTag[5],"Maces";
//set .@ShopTag[6],"Wands";
//set .@ShopTag[7],"Bows";
//set .@ShopTag[8],"Knuckles";
//set .@ShopTag[9],"Instruments";
//set .@ShopTag[10],"Whips";
//set .@ShopTag[11],"Books";
//set .@ShopTag[12],"Guns";
//set .@ShopTag[13],"Huuma and Kunai";
//set .@ShopTag[14],"Katars";
//setarray .@ShopTag$[1],"Daggers","Swords","Spears","Axes","Maces","Wands","Bows","Knuckles","Instruments","Whips","Books","Guns","Huuma and Kunai","Katars";
//setarray .@Shops$[1],"( ^0000FFDaggers^000000 )","( ^0000FFSwords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFMaces^000000 )","( ^0000FFWands^000000 )","( ^0000FFBows^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
//set .@MaxShops,14; // Total Array size (shops)
// ^0000FF - Blue
// ^FF0000 - Red

switch (BaseClass) {
 case Job_Novice: setarray .@ShopTag$[1],"Daggers","Swords","Spears","Axes","Maces","Wands","Bows","Knuckles","Instruments","Whips","Books","Guns","Huuma and Kunai","Katars";
  setarray .@Shops$[1],"( ^FF0000Daggers^000000 )","( ^FF0000Swords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFMaces^000000 )","( ^0000FFWands^000000 )","( ^0000FFBows^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
  break;
 case Job_Swordman: setarray .@ShopTag$[1],"Swords","Spears","Daggers","Axes","Maces","Wands","Bows","Knuckles","Instruments","Whips","Books","Guns","Huuma and Kunai","Katars";
  setarray .@Shops$[1],"( ^FF0000Swords^000000 )","( ^FF0000Spears^000000 )","( ^0000FFDaggers^000000 )","( ^0000FFAxes^000000 )","( ^0000FFMaces^000000 )","( ^0000FFWands^000000 )","( ^0000FFBows^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
  break;
 case Job_Mage: setarray .@ShopTag$[1],"Wands","Daggers","Swords","Spears","Axes","Maces","Bows","Knuckles","Instruments","Whips","Books","Guns","Huuma and Kunai","Katars";
  setarray .@Shops$[1],"( ^FF0000Wands^000000 )","( ^0000FFDaggers^000000 )","( ^0000FFSwords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFMaces^000000 )","( ^0000FFBows^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
  break;
 case Job_Archer: setarray .@ShopTag$[1],"Bows","Daggers","Swords","Spears","Axes","Maces","Wands","Knuckles","Instruments","Whips","Books","Guns","Huuma and Kunai","Katars";
  setarray .@Shops$[1],"( ^FF0000Bows^000000 )","( ^0000FFDaggers^000000 )","( ^0000FFSwords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFMaces^000000 )","( ^0000FFWands^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
  break;
 case Job_Acolyte: setarray .@ShopTag$[1],"Maces","Wands","Daggers","Swords","Spears","Axes","Bows","Knuckles","Instruments","Whips","Books","Guns","Huuma and Kunai","Katars";
  setarray .@Shops$[1],"( ^FF0000Maces^000000 )","( ^FF0000Wands^000000 )","( ^0000FFDaggers^000000 )","( ^0000FFSwords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFBows^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
  break;
 case Job_Merchant: setarray .@ShopTag$[1],"Axes","Daggers","Maces","Swords","Spears","Wands","Bows","Knuckles","Instruments","Whips","Books","Guns","Huuma and Kunai","Katars";
  setarray .@Shops$[1],"( ^FF0000Axes^000000 )","( ^FF0000Daggers^000000 )","( ^FF0000Maces^000000 )","( ^FF0000Swords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFWands^000000 )","( ^0000FFBows^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
  break;
 case Job_Thief: setarray .@ShopTag$[1],"Daggers","Bows","Swords","Spears","Axes","Maces","Wands","Knuckles","Instruments","Whips","Books","Guns","Huuma and Kunai","Katars";
  setarray .@Shops$[1],"( ^FF0000Daggers^000000 )","( ^FF0000Bows^000000 )","( ^0000FFSwords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFMaces^000000 )","( ^0000FFWands^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
  break;
 default: // Set default to avoid errors
setarray .@ShopTag$[1],"Daggers","Swords","Spears","Axes","Maces","Wands","Bows","Knuckles","Instruments","Whips","Books","Guns","Huuma and Kunai","Katars";
setarray .@Shops$[1],"( ^0000FFDaggers^000000 )","( ^0000FFSwords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFMaces^000000 )","( ^0000FFWands^000000 )","( ^0000FFBows^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
break; }
// Override original shops if any of these are "True"
switch (BaseJob) {
 case Job_Priest: setarray .@ShopTag$[1],"Maces","Wands","Books","Knuckles","Daggers","Swords","Spears","Axes","Bows","Instruments","Whips","Guns","Huuma and Kunai","Katars";
  setarray .@Shops$[1],"( ^FF0000Maces^000000 )","( ^FF0000Wands^000000 )","( ^FF0000Books^000000 )","( ^FF0000Knuckles^000000 )","( ^0000FFDaggers^000000 )","( ^0000FFSwords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFBows^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
  break;
 case Job_Assassin: setarray .@ShopTag$[1],"Daggers","Katars","Swords","Spears","Axes","Maces","Wands","Bows","Knuckles","Instruments","Whips","Books","Guns","Huuma and Kunai";
  setarray .@Shops$[1],"( ^FF0000Daggers^000000 )","( ^FF0000Katars^000000 )","( ^FF0000Swords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFMaces^000000 )","( ^0000FFWands^000000 )","( ^0000FFBows^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )";
  break;
 case Job_Monk: setarray .@ShopTag$[1],"Maces","Knuckles","Daggers","Swords","Spears","Axes","Wands","Bows","Instruments","Whips","Books","Guns","Huuma and Kunai","Katars";
setarray .@Shops$[1],"( ^FF0000Maces^000000 )","( ^FF0000Knuckles^000000 )","( ^0000FFDaggers^000000 )","( ^0000FFSwords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFWands^000000 )","( ^0000FFBows^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
break;
 case Job_Sage: setarray .@ShopTag$[1],"Books","Wands","Daggers","Swords","Spears","Axes","Maces","Bows","Knuckles","Instruments","Whips","Guns","Huuma and Kunai","Katars";
setarray .@Shops$[1],"( ^FF0000Wands^000000 )","( ^FF0000Books^000000 )","( ^0000FFDaggers^000000 )","( ^0000FFSwords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFMaces^000000 )","( ^0000FFBows^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
break;
 case Job_Rogue: setarray .@ShopTag$[1],"Daggers","Swords","Bows","Spears","Axes","Maces","Wands","Knuckles","Instruments","Whips","Books","Guns","Huuma and Kunai","Katars";
setarray .@Shops$[1],"( ^FF0000Daggers^000000 )","( ^FF0000Swords^000000 )","( ^FF0000Bows^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFMaces^000000 )","( ^0000FFWands^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
break;
 case Job_Bard: setarray .@ShopTag$[1],"Bows","Instruments","Daggers","Swords","Spears","Axes","Maces","Wands","Knuckles","Whips","Books","Guns","Huuma and Kunai","Katars";
setarray .@Shops$[1],"( ^FF0000Bows^000000 )","( ^FF0000Instruments^000000 )","( ^FF0000Daggers^000000 )","( ^0000FFSwords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFMaces^000000 )","( ^0000FFWands^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
break;
 case Job_Dancer: setarray .@ShopTag$[1],"Bows","Whips","Daggers","Swords","Spears","Axes","Maces","Wands","Knuckles","Instruments","Books","Guns","Huuma and Kunai","Katars";
setarray .@Shops$[1],"( ^FF0000Bows^000000 )","( ^FF0000Whips^000000 )","( ^FF0000Daggers^000000 )","( ^0000FFSwords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFMaces^000000 )","( ^0000FFWands^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
break;
 case Job_Gunslinger: setarray .@ShopTag$[1],"Guns","Daggers","Swords","Spears","Axes","Maces","Wands","Bows","Knuckles","Instruments","Whips","Books","Huuma and Kunai","Katars";
setarray .@Shops$[1],"( ^FF0000Guns^000000 )","( ^0000FFDaggers^000000 )","( ^0000FFSwords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFMaces^000000 )","( ^0000FFWands^000000 )","( ^0000FFBows^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
break;
 case Job_Ninja: setarray .@ShopTag$[1],"Huuma and Kunai","Daggers","Swords","Spears","Axes","Maces","Wands","Bows","Knuckles","Instruments","Whips","Books","Guns","Katars";
setarray .@Shops$[1],"( ^FF0000Huuma and Kunai^000000 )","( ^0000FFDaggers^000000 )","( ^0000FFSwords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFMaces^000000 )","( ^0000FFWands^000000 )","( ^0000FFBows^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFKatars^000000 )";
break;
 case Job_Taekwon: // Taekwon is defaulted just in case.
  setarray .@ShopTag$[1],"Daggers","Swords","Spears","Axes","Maces","Wands","Bows","Knuckles","Instruments","Whips","Books","Guns","Huuma and Kunai","Katars";
  setarray .@Shops$[1],"( ^0000FFDaggers^000000 )","( ^0000FFSwords^000000 )","( ^0000FFSpears^000000 )","( ^0000FFAxes^000000 )","( ^0000FFMaces^000000 )","( ^0000FFWands^000000 )","( ^0000FFBows^000000 )","( ^0000FFKnuckles^000000 )","( ^0000FFInstruments^000000 )","( ^0000FFWhips^000000 )","( ^0000FFBooks^000000 )","( ^0000FFGuns^000000 )","( ^0000FFHuuma and Kunai^000000 )","( ^0000FFKatars^000000 )";
  break;
 default: // Do nothing
 break;  }
mes "[ ^0000FFWeapon Shop^000000 ]";
mes "Please choose your desired shop.";
set .@menu,select(.@Shops$[1],.@Shops$[2],.@Shops$[3],.@Shops$[4],.@Shops$[5],.@Shops$[6],.@Shops$[7],.@Shops$[8],.@Shops$[9],.@Shops$[10],.@Shops$[11],.@Shops$[12],.@Shops$[13],.@Shops$[14]);

callshop .@ShopTag$[.@menu],1;

close;
}
- shop Daggers -1,1203:-1,1201:-1,1202:-1,1206:-1,1204:-1,1205:-1,1209:-1,1207:-1,1208:-1,1212:-1,1210:-1,1211:-1,1215:-1,1213:-1,1214:-1,1218:-1,1216:-1,1217:-1,1221:-1,1219:-1,1220:-1,1222:-1,1226:-1,1245:-1,1246:-1,1247:-1,1248:-1,1249:-1,13000:-1,13003:-1,13004:-1
- shop Swords -1,1103:-1,1101:-1,1102:-1,1106:-1,1104:-1,1105:-1,1109:-1,1107:-1,1108:-1,1112:-1,1110:-1,1111:-1,1113:-1,1114:-1,1121:-1,1119:-1,1120:-1,1122:-1,1125:-1,1123:-1,1128:-1,1126:-1,1127:-1,1129:-1,1149:-1,1146:-1,1147:-1,1118:-1,1116:-1,1117:-1,1153:-1,1151:-1,1152:-1,1156:-1,1154:-1,1155:-1,1159:-1,1157:-1,1158:-1,1160:-1,1162:-1,1163:-1,31172:-1,1172:-1
- shop Spears -1,1403:-1,1401:-1,1402:-1,1406:-1,1404:-1,1405:-1,1409:-1,1407:-1,1408:-1,1411:-1,1453:-1,1451:-1,1452:-1,1456:-1,1454:-1,1455:-1,1459:-1,1457:-1,1458:-1,1462:-1,1460:-1,1461:-1,1465:-1,1463:-1,1464:-1
- shop Axes -1,1303:-1,1301:-1,1302:-1,1353:-1,1351:-1,1352:-1,1356:-1,1354:-1,1355:-1,1359:-1,1357:-1,1358:-1,1362:-1,1360:-1,1361:-1
- shop Maces -1,1503:-1,1501:-1,1502:-1,1506:-1,1504:-1,1505:-1,1509:-1,1507:-1,1508:-1,1512:-1,1510:-1,1511:-1,1519:-1,1520:-1,1521:-1,1513:-1,1514:-1,1515:-1,1516:-1,1517:-1,1518:-1,1522:-1,1532:-1
- shop Wands -1,1603:-1,1601:-1,1602:-1,1606:-1,1604:-1,1605:-1,1609:-1,1607:-1,1608:-1,1612:-1,1610:-1,1611:-1,1617:-1,1618:-1,1619:-1,1620:-1
- shop Bows -1,1703:-1,1701:-1,1702:-1,1706:-1,1704:-1,1705:-1,1709:-1,1707:-1,1708:-1,1712:-1,1710:-1,1711:-1,1713:-1,1715:-1,1714:-1,1716:-1,1726:-1,1721:-1
- shop Knuckles -1,1801:-1,1802:-1,1803:-1,1804:-1,1805:-1,1806:-1,1807:-1,1808:-1,1809:-1,1810:-1,1811:-1,1812:-1
- shop Instruments -1,1901:-1,1902:-1,1903:-1,1904:-1,1905:-1,1906:-1,1907:-1,1908:-1,1909:-1,1910:-1,1921:-1,1911:-1,1912:-1,1913:-1
- shop Whips -1,1950:-1,1951:-1,1952:-1,1953:-1,1954:-1,1955:-1,1956:-1,1957:-1,1958:-1,1959:-1,1960:-1,1961:-1,1963:-1
- shop Books -1,1550:-1,1551:-1,1552:-1,1553:-1,1568:-1,1554:-1,1569:-1,1570:-1,1556:-1,1571:-1,1557:-1,1578:-1
- shop Guns -1,13102:-1,13103:-1,13150:-1,13151:-1,13152:-1,13163:-1,13164:-1,13165:-1,13166:-1,13154:-1,13155:-1,13168:-1,13169:-1
- shop Huuma and Kunai -1,13010:-1,13011:-1,13007:-1,13008:-1,13012:-1,13013:-1,13006:-1,13300:-1,13301:-1,13302:-1,13303:-1,13311:-1,13313:-1,13314:-1,13315:-1,13312:-1
- shop Katars -1,1250:-1,1251:-1,1252:-1,1253:-1,1254:-1,1255:-1

One alternative would be make the label name be the shop name that is called... but then I lose the colors and the formatting unless I make some uniquely clever string scrubber to filter out the color and everything.

Essentially, just not having to call an enormous switch in the beginning would be good. =P

Edited by AnnieRuru
use [codebox] if the script > 10 lines
Link to comment
Share on other sites

21 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

prt_in,172,140,3	script	Weapon Shop	951,{
function SetShop;

switch (BaseJob) {
  case Job_Priest: SetShop(4,5,10,7);
  case Job_Assassin: SetShop(0,13,1);
  case Job_Monk: SetShop(4,7);
  case Job_Sage: SetShop(5,10);
  case Job_Rogue: SetShop(0,1,6);
  case Job_Bard: SetShop(6,8,0);
  case Job_Dancer: SetShop(6,9,0);
  case Job_Gunslinger: SetShop(11);
  case Job_Ninja: SetShop(12);
  default:
	switch (BaseClass) {
	  case Job_Novice: SetShop(0,1);
	  case Job_Swordman: SetShop(1,2);
	  case Job_Mage: SetShop(5);
	  case Job_Archer: SetShop(6);
	  case Job_Acolyte: SetShop(4,5);
	  case Job_Merchant: SetShop(3,0,4,1);
	  case Job_Thief: SetShop(0,6);
	  default: SetShop();
	}
}

function SetShop {
for(set .@i,0; .@i<getargcount(); set .@i,.@i+1) {
	set .@menu$, .@menu$+"( ^FF0000"+.Shops$[getarg(.@i)]+"^000000 ):";
	set .@j[getarraysize(.@j)], getarg(.@i)+1;
	set .@k, .@k | (1<<getarg(.@i));
}
for(set .@i,0; .@i<getarraysize(.Shops$); set .@i,.@i+1)
	if (!(.@k & (1<<.@i))) {
		set .@menu$, .@menu$+"( ^0000FF"+.Shops$[.@i]+"^000000 ):";
		set .@j[getarraysize(.@j)], .@i+1;
	}
mes "[ ^0000FFWeapon Shop^000000 ]";
mes "Please choose your desired shop.";
next;
callshop .Shops$[.@j[select(.@menu$)-1]-1],1;
close;
}

OnInit:
setarray .Shops$[0],
  "Daggers",		// 0
  "Swords",		// 1
  "Spears",		// 2
  "Axes", 		// 3
  "Maces",		// 4
  "Wands",		// 5
  "Bows", 		// 6
  "Knuckles",		// 7
  "Instruments",	// 8
  "Whips",		// 9
  "Books",		// 10
  "Guns", 		// 11
  "Huuma and Kunai",	// 12
  "Katars";		// 13
end;
}
-	shop	Daggers	-1,1203:-1,1201:-1,1202:-1,1206:-1,1204:-1,1205:-1,1209:-1,1207:-1,1208:-1,1212:-1,1210:-1,1211:-1,1215:-1,1213:-1,1214:-1,1218:-1,1216:-1,1217:-1,1221:-1,1219:-1,1220:-1,1222:-1,1226:-1,1245:-1,1246:-1,1247:-1,1248:-1,1249:-1,13000:-1,13003:-1,13004:-1
-	shop	Swords	-1,1103:-1,1101:-1,1102:-1,1106:-1,1104:-1,1105:-1,1109:-1,1107:-1,1108:-1,1112:-1,1110:-1,1111:-1,1113:-1,1114:-1,1121:-1,1119:-1,1120:-1,1122:-1,1125:-1,1123:-1,1128:-1,1126:-1,1127:-1,1129:-1,1149:-1,1146:-1,1147:-1,1118:-1,1116:-1,1117:-1,1153:-1,1151:-1,1152:-1,1156:-1,1154:-1,1155:-1,1159:-1,1157:-1,1158:-1,1160:-1,1162:-1,1163:-1,31172:-1,1172:-1
-	shop	Spears	-1,1403:-1,1401:-1,1402:-1,1406:-1,1404:-1,1405:-1,1409:-1,1407:-1,1408:-1,1411:-1,1453:-1,1451:-1,1452:-1,1456:-1,1454:-1,1455:-1,1459:-1,1457:-1,1458:-1,1462:-1,1460:-1,1461:-1,1465:-1,1463:-1,1464:-1
-	shop	Axes	-1,1303:-1,1301:-1,1302:-1,1353:-1,1351:-1,1352:-1,1356:-1,1354:-1,1355:-1,1359:-1,1357:-1,1358:-1,1362:-1,1360:-1,1361:-1
-	shop	Maces	-1,1503:-1,1501:-1,1502:-1,1506:-1,1504:-1,1505:-1,1509:-1,1507:-1,1508:-1,1512:-1,1510:-1,1511:-1,1519:-1,1520:-1,1521:-1,1513:-1,1514:-1,1515:-1,1516:-1,1517:-1,1518:-1,1522:-1,1532:-1
-	shop	Wands	-1,1603:-1,1601:-1,1602:-1,1606:-1,1604:-1,1605:-1,1609:-1,1607:-1,1608:-1,1612:-1,1610:-1,1611:-1,1617:-1,1618:-1,1619:-1,1620:-1
-	shop	Bows	-1,1703:-1,1701:-1,1702:-1,1706:-1,1704:-1,1705:-1,1709:-1,1707:-1,1708:-1,1712:-1,1710:-1,1711:-1,1713:-1,1715:-1,1714:-1,1716:-1,1726:-1,1721:-1
-	shop	Knuckles	-1,1801:-1,1802:-1,1803:-1,1804:-1,1805:-1,1806:-1,1807:-1,1808:-1,1809:-1,1810:-1,1811:-1,1812:-1
-	shop	Instruments	-1,1901:-1,1902:-1,1903:-1,1904:-1,1905:-1,1906:-1,1907:-1,1908:-1,1909:-1,1910:-1,1921:-1,1911:-1,1912:-1,1913:-1
-	shop	Whips	-1,1950:-1,1951:-1,1952:-1,1953:-1,1954:-1,1955:-1,1956:-1,1957:-1,1958:-1,1959:-1,1960:-1,1961:-1,1963:-1
-	shop	Books	-1,1550:-1,1551:-1,1552:-1,1553:-1,1568:-1,1554:-1,1569:-1,1570:-1,1556:-1,1571:-1,1557:-1,1578:-1
-	shop	Guns	-1,13102:-1,13103:-1,13150:-1,13151:-1,13152:-1,13163:-1,13164:-1,13165:-1,13166:-1,13154:-1,13155:-1,13168:-1,13169:-1
-	shop	Huuma and Kunai	-1,13010:-1,13011:-1,13007:-1,13008:-1,13012:-1,13013:-1,13006:-1,13300:-1,13301:-1,13302:-1,13303:-1,13311:-1,13313:-1,13314:-1,13315:-1,13312:-1
-	shop	Katars	-1,1250:-1,1251:-1,1252:-1,1253:-1,1254:-1,1255:-1

http://upaste.me/raw/a5e71739a63abd83

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

Essentially, just not having to call an enormous switch in the beginning would be good. =P
I've tried out several methods

seems like 'enormous switch in the beginning' is unavoidable

prontera,156,184,4	script	ksdjfhskhfj	100,{
mes "blah";
switch ( basejob ) {
	case Job_Novice: case Job_SuperNovice:
		.@job = 0; break;
	case Job_Swordman:
		.@job = 1; break;
	case Job_Mage:
		.@job = 2; break;
	case Job_Archer:
		.@job = 3; break;
	case Job_Acolyte:
		.@job = 4; break;
	case Job_Merchant:
		.@job = 5; break;
	case Job_Thief:
		.@job = 6; break;
	case Job_Knight:
		.@job = 7; break;
	case Job_Priest:
		.@job = 8; break;
	case Job_Wizard:
		.@job = 9; break;
	case Job_Blacksmith:
		.@job = 10; break;
	case Job_Hunter:
		.@job = 11; break;
	case Job_Assassin:
		.@job = 12; break;
	case Job_Crusader:
		.@job = 14; break;
	case Job_Monk:
		.@job = 15; break;
	case Job_Sage:
		.@job = 16; break;
	case Job_Rogue:
		.@job = 17; break;
	case Job_Alchemist:
		.@job = 18; break;
	case Job_Bard: case Job_Dancer:
		.@job = 19; break;
	case Job_Taekwon:
		.@job = 21; break;
	case Job_Star_Gladiator:
		.@job = 22; break;
	case Job_Soul_Linker:
		.@job = 23; break;
	case Job_Gunslinger:
		.@job = 24; break;
	case Job_Ninja:
		.@job = 25; break;
	default:
		mes "error";
		close;
}
.@s = select( .menu$[ .@job ] );
close2;
callshop "weapon_shop#"+ .@s, 1;
end;
OnInit:
setarray .weaponname$[1],
	"Daggers",
	"One-handed swords",
	"Two-handed swords",
	"One-handed spears",
	"Two-handed spears",
	"One-handed axes",
	"Two-handed axes",
	"Maces",
	"", // <-- stupid unused
	"Staves",
	"Bows",
	"Knuckles",
	"Musical Instruments",
	"Whips",
	"Books",
	"Katars",
	"Revolvers",
	"Rifles",
	"Gatling guns",
	"Shotguns",
	"Grenade launchers",
	"Fuuma Shurikens",
	"Two-handed staves";
// select hex( sum(aaa) ) from ( select 1 << view as aaa from item_db where type = 4 && equip_jobs & 1<<0 group by view ) as zzz;
setarray .@weaponbits,
	0x54E, // 0 novice
	0x1FE, // 1 swordsman
	0x80050A, // 2 mage
	0x90A, // 3 archer
	0x80050A, // 4 acolyte
	0x1CE, // 5 merchant
	0x94E, // 6 thief
	0x1FE, // 7 knight
	0x80950A, // 8 priest
	0x80050A, // 9 wizard
	0x1CE, // 10 blacksmith
	0x90A, // 11 hunter
	0x1014E, // 12 assassin
	-1, // 13 unused
	0x1FE, // 14 crusader
	0x80150A, // 15 monk
	0x80850A, // 16 sage
	0x94E, // 17 rogue
	0x1CE, // 18 alchemist
	0x690A, // 19 barddancer
	-1, // 20 unused
	0x10A, // 21 taekwon
	0x810A, // 22 star gladiator
	0x80050A, // 23 soul linker
	0x3E010A, // 24 gunslinger
	0x40010A; // 25 ninja
freeloop 1;
for ( .@j = 0; .@j <= 25; .@j++ ) { // job index
	if ( .@j == 13 || .@j == 20 ) continue;
	for ( .@i = 1; .@i <= 22; .@i++ ) { // weapon index
		if ( .@i != 9 ) .menu$[.@j] = .menu$[.@j] +( ( .@weaponbits[.@j] & 1 << .@i )? "^00FF00" : "^FF0000" )+ .weaponname$[.@i] +":";
		else .menu$[.@j] = .menu$[.@j] +":";
	}
}
.@i = 1;
while ( .@i <= 23 ){
	.@nb = query_sql( "select id from item_db where type = 4 && view = "+ .@i, .@id );
	npcshopdelitem "weapon_shop#"+ .@i, 501;
	.@j = 0;
	while ( .@j < .@nb ) {
		npcshopadditem "weapon_shop#"+ .@i, .@id[.@j], getiteminfo( .@id[.@j], 0 );
		.@j++;
	}
	.@i++;
}
freeloop 0;
end;
}
-	shop	weapon_shop#1	-1,501:1000
-	shop	weapon_shop#2	-1,501:1000
-	shop	weapon_shop#3	-1,501:1000
-	shop	weapon_shop#4	-1,501:1000
-	shop	weapon_shop#5	-1,501:1000
-	shop	weapon_shop#6	-1,501:1000
-	shop	weapon_shop#7	-1,501:1000
-	shop	weapon_shop#8	-1,501:1000
-	shop	weapon_shop#10	-1,501:1000
-	shop	weapon_shop#11	-1,501:1000
-	shop	weapon_shop#12	-1,501:1000
-	shop	weapon_shop#13	-1,501:1000
-	shop	weapon_shop#14	-1,501:1000
-	shop	weapon_shop#15	-1,501:1000
-	shop	weapon_shop#16	-1,501:1000
-	shop	weapon_shop#17	-1,501:1000
-	shop	weapon_shop#18	-1,501:1000
-	shop	weapon_shop#19	-1,501:1000
-	shop	weapon_shop#20	-1,501:1000
-	shop	weapon_shop#21	-1,501:1000
-	shop	weapon_shop#22	-1,501:1000
-	shop	weapon_shop#23	-1,501:1000

btw I don't hold back in my scripting technique ... so take your time to crack this

EDIT: wtf ???? post at same time

EDIT2:

editing script ....

done

I think the main difference is Euphy script calculate it when the script call for it

while mine has already did itself when server startup

EDIT3: from below

wow thx for reminding !

EDIT4:

fix a bug on .@s = select( .menu$ ); ... missing index

Edited by AnnieRuru
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

@Annie: Small mistake here:

	for ( .@i = 1; .@i <= 22; .@i++ ) {
	if ( .@i == 9 ) .@menu$ = .@menu$ +":"; // 'continue' would skip an array element
	else .@menu$ = .@menu$ +( ( .weaponbits[ .@job ] & 1 << .@i )? "^00FF00" : "^FF0000" )+ .weaponname$[ .@i ] +":";
}

Great work though. o.o

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

Geez.....both of you posted while i was squeezing out the script from my brain.. >.<

haha ~

try this

http://pastebin.com/raw.php?i=4nbGh0ke

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

wow ... scary !!

its been sometime I get this 'defeated' feeling

/wah

the last time I got this feeling is when having script showdown with keyworld last year....

I think Emistry script is the one closest to Vach scripting level

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   19
  • Joined:  09/27/12
  • Last Seen:  

OMMMMMMGGGGGGG BRAIN PASTE.

Annie your script scares me, seems larger than the rest... but maybe it is more efficient and I just don't understand it. XD

In an effort to further my scripting knowledge, I am going to ask some questions on the scripts that didn't melt my brain (don't hate me Annie!).

Euphy:

I think I understand what's going on here. You set the shops that are moved to the front in the switch in the beginning using a function, which essentially follows the same switch I had it just is reorganized and looks nicer. The function actually runs the NPC (text and menu, etc). The part where I get confused is the function definition. I understand the part where you dynamically create the menu text which will be used in the callshop select usage. And ".@j" is used to actually set the number used to call the shop (the order that the menu options are in numbers). Since, select returns a number the player picks.

The part where I lose it is the second loop. That's a bit variable right, with bit shifting (which we have discussion previously)? In hindsight I didn't even know "getargcount()" existed, which will help me improve a couple of my more dynamic scripts. So the second loop sets the rest of the .@menu$ variable so that all the other shops exist in the menu... but I can't seem to understand the dynamics of what's going on in that if statement. You're checking if the previous bit variable is true for each initial "slot" in the menu?

Emistry:

This looks like it's missing some of the class checks (Jobs), but I think I am meant to edit it after I understand it? So does this essentially repeat the method I was using by creating the arrays ahead of time, but in much more efficient fashion? After that I get confused.

So the loop creates the menu variable for use with select(), but it's checking whether the shop name is red or blue based on the value of .@shop_list[0]? Only the item in index 0? What is the significance of index zero in this case? And the -1 to the .@shop_list variable at the end of the 'set' is because .@i is set to 1 initially, correct?

Essentially, .@shop_name$ helps create the menu "list" and is then used to dynamically call the right shop with callshop, and we create a list of items that matches .@shop_list to .@menu$. Or more specifically the other way around. I'm just not understanding how that one loop determines which way to color the menu variable. I think I understand how the correct shop is called, however. Those variables never change.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

erm...my script..is almost the same like yours....for the Job Checking part... you can still do it exactly like you want...use a switch( BaseJob ) or etc...then give a correspond array list...( which is the shop listing )....

i didnt set 2 array for shop name and menu listing because all this can be done using 1 array in your case....

the .@shop_list[0] show that how many shop in the menu will be coloured as Blue...the first X-th Shop will be coloured in blue...depend on the number in index 0...

and yes...the select command will start with 1 and not 0..so i have to -1 to get the correct shop index to call for the correspond shop

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

// SetShop({#{,#{,...}}});
function SetShop {
// Create the first, red menu options based on arguments passed.
for(set .@i,0; .@i<getargcount(); set .@i,.@i+1) {
	// Add each shop name, in order, to the menu.
	set .@menu$, .@menu$+"( ^FF0000"+.Shops$[getarg(.@i)]+"^000000 ):";
	// Store shop number in an array to call later.
	// Has +1 to prevent skipping an element if 0 is passed (subtract 1 later).
	set .@j[getarraysize(.@j)], getarg(.@i)+1;
	// Set the bit for the shop number passed, so
	// that it doesn't get added twice (in the next loop).
	set .@k, .@k | (1<<getarg(.@i));
}
// Create the other default, blue menu options.
for(set .@i,0; .@i<getarraysize(.Shops$); set .@i,.@i+1)
	// Only run if the shop bit is NOT set, or
	// you'll get duplicates from the first loop.
	if (!(.@k & (1<<.@i))) {
		// Add each shop name to the menu.
		set .@menu$, .@menu$+"( ^0000FF"+.Shops$[.@i]+"^000000 ):";
		// Store shop number in an array.
		set .@j[getarraysize(.@j)], .@i+1;
	}
mes "[ ^0000FFWeapon Shop^000000 ]";
mes "Please choose your desired shop.";
next;
// Call shop based on menu option selected.
//   select(.@menu$)-1 : returns menu array element.
//   .@j[]-1 : array element in relation to .Shops$ array.
//   .Shops$[] : stores shop names.
callshop .Shops$[.@j[select(.@menu$)-1]-1],1;
close;
}

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

What!? I missed the showdown T.T; I hate work xD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  60
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   219
  • Joined:  11/22/11
  • Last Seen:  

based on Euphy's function, just try to change it to my style XD

(I don't know what is ''<<'' XD)

http://pastebin.com/raw.php?i=0geqsrjs

Edited by goddameit
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

Funny thing, I did the same than Euphy... but mine is easier to edit :P

prt_in.gat,172,140,3    script    Weapons Shop    951,{
   function enum;


   switch( BaseJob ) {
       case Job_Priest:     setarray .@priority, .TYPE_MACE, .TYPE_WAND, .TYPE_BOOK, .TYPE_KNUCKLE; break;
       case Job_Assassin:   setarray .@priority, .TYPE_DAGGER, .TYPE_KATAR, .TYPE_SWORD; break;
       case Job_Monk:       setarray .@priority, .TYPE_MACE, .TYPE_KNUCKLE; break;
       case Job_Sage:       setarray .@priority, .TYPE_WAND, .TYPE_BOOK; break;
       case Job_Rogue:      setarray .@priority, .TYPE_DAGGER, .TYPE_SWORD, .TYPE_BOW; break;
       case Job_Bard:       setarray .@priority, .TYPE_BOW, .TYPE_INSTRUMENT, .TYPE_DAGGER; break;
       case Job_Dancer:     setarray .@priority, .TYPE_BOW, .TYPE_WHIP, .TYPE_DAGGER; break;
       case Job_Gunslinger: setarray .@priority, .TYPE_GUN; break;
       case Job_Ninja:      setarray .@priority, .TYPE_KUNAI; break;

       // Base class, if not in list
       default:
           switch( BaseClass ) {
               case Job_Novice:   setarray .@priority, .TYPE_DAGGER, .TYPE_SWORD; break;
               case Job_Swordman: setarray .@priority, .TYPE_SWORD, .TYPE_SPEAR;  break;
               case Job_Mage:     setarray .@priority, .TYPE_WAND; break;
               case Job_Archer:   setarray .@priority, .TYPE_BOW; break;
               case Job_Acolyte:  setarray .@priority, .TYPE_MACE, .TYPE_WAND; break;
               case Job_Merchant: setarray .@priority, .TYPE_AXE, .TYPE_DAGGER, .TYPE_MACE, .TYPE_SWORD; break;
               case Job_Thief:    setarray .@priority, .TYPE_DAGGER, .TYPE_BOW; break;
           }
   }


   set .@size, getarraysize(.@priority);

   // Priority menu
   if ( .@size ) {
       for (set .@menu$, "^FF0000"; .@i<.@size; set .@i, .@i + 1 ) {
           set .@type, .@priority[.@i];
           set .@menu$, .@menu$ + ( .@i ? ":" : "") + .TYPE_NAME$[.@type];
           set .@list[.@i], .@type;
           set .@types[.@type], 1;
       }
   }

   // Other menu
   for ( set .@menu$, .@menu$ + "^0000FF"; .@j<.TYPE_MAX; set .@j, .@j + 1 ) {
       if ( !.@types[.@j] ) {
           set .@menu$, .@menu$ + ( .@size+.@j ? ":" : "" ) + .TYPE_NAME$[.@j];
           set .@types[.@j], 1;
           set .@list[.@size+.@j], .@j;
       }
   }

   // Display menu
   callshop .TYPE_NAME$[ .@list[select(.@menu$) - 1] ];
   close;


OnInit:

   // Constantes
   enum(
       .TYPE_DAGGER,
       .TYPE_SWORD,
       .TYPE_SPEAR,
       .TYPE_AXE,
       .TYPE_MACE,
       .TYPE_WAND,
       .TYPE_BOW,
       .TYPE_KNUCKLE,
       .TYPE_INSTRUMENT,
       .TYPE_WHIP,
       .TYPE_BOOK,
       .TYPE_GUN,
       .TYPE_KUNAI,
       .TYPE_KATAR,
       .TYPE_MAX
   );

   // Define name base on constantes
   set .TYPE_NAME$[.TYPE_DAGGER],     "Daggers";
   set .TYPE_NAME$[.TYPE_SWORD],      "Swords";
   set .TYPE_NAME$[.TYPE_SPEAR],      "Spears";
   set .TYPE_NAME$[.TYPE_AXE],        "Axes";
   set .TYPE_NAME$[.TYPE_MACE],       "Maces";
   set .TYPE_NAME$[.TYPE_WAND],       "Wands";
   set .TYPE_NAME$[.TYPE_BOW],        "Bows";
   set .TYPE_NAME$[.TYPE_KNUCKLE],    "Knuckles";
   set .TYPE_NAME$[.TYPE_INSTRUMENT], "Instruments";
   set .TYPE_NAME$[.TYPE_WHIP],       "Whips";
   set .TYPE_NAME$[.TYPE_BOOK],       "Books";
   set .TYPE_NAME$[.TYPE_GUN],        "Guns";
   set .TYPE_NAME$[.TYPE_KUNAI],      "Huuma and Kunai";
   set .TYPE_NAME$[.TYPE_KATAR],      "Katars";

   // Enum functions
   function enum {
       for ( set .@size, getargcount(); .@i<.@size; set .@i, .@i+1 )
           set getarg(.@i), .@i;
   }
}

-    shop    Daggers    -1,1203:-1,1201:-1,1202:-1,1206:-1,1204:-1,1205:-1,1209:-1,1207:-1,1208:-1,1212:-1,1210:-1,1211:-1,1215:-1,1213:-1,1214:-1,1218:-1,1216:-1,1217:-1,1221:-1,1219:-1,1220:-1,1222:-1,1226:-1,1245:-1,1246:-1,1247:-1,1248:-1,1249:-1,13000:-1,13003:-1,13004:-1
-    shop    Swords    -1,1103:-1,1101:-1,1102:-1,1106:-1,1104:-1,1105:-1,1109:-1,1107:-1,1108:-1,1112:-1,1110:-1,1111:-1,1113:-1,1114:-1,1121:-1,1119:-1,1120:-1,1122:-1,1125:-1,1123:-1,1128:-1,1126:-1,1127:-1,1129:-1,1149:-1,1146:-1,1147:-1,1118:-1,1116:-1,1117:-1,1153:-1,1151:-1,1152:-1,1156:-1,1154:-1,1155:-1,1159:-1,1157:-1,1158:-1,1160:-1,1162:-1,1163:-1,31172:-1,1172:-1
-    shop    Spears    -1,1403:-1,1401:-1,1402:-1,1406:-1,1404:-1,1405:-1,1409:-1,1407:-1,1408:-1,1411:-1,1453:-1,1451:-1,1452:-1,1456:-1,1454:-1,1455:-1,1459:-1,1457:-1,1458:-1,1462:-1,1460:-1,1461:-1,1465:-1,1463:-1,1464:-1
-    shop    Axes    -1,1303:-1,1301:-1,1302:-1,1353:-1,1351:-1,1352:-1,1356:-1,1354:-1,1355:-1,1359:-1,1357:-1,1358:-1,1362:-1,1360:-1,1361:-1
-    shop    Maces    -1,1503:-1,1501:-1,1502:-1,1506:-1,1504:-1,1505:-1,1509:-1,1507:-1,1508:-1,1512:-1,1510:-1,1511:-1,1519:-1,1520:-1,1521:-1,1513:-1,1514:-1,1515:-1,1516:-1,1517:-1,1518:-1,1522:-1,1532:-1
-    shop    Wands    -1,1603:-1,1601:-1,1602:-1,1606:-1,1604:-1,1605:-1,1609:-1,1607:-1,1608:-1,1612:-1,1610:-1,1611:-1,1617:-1,1618:-1,1619:-1,1620:-1
-    shop    Bows    -1,1703:-1,1701:-1,1702:-1,1706:-1,1704:-1,1705:-1,1709:-1,1707:-1,1708:-1,1712:-1,1710:-1,1711:-1,1713:-1,1715:-1,1714:-1,1716:-1,1726:-1,1721:-1
-    shop    Knuckles    -1,1801:-1,1802:-1,1803:-1,1804:-1,1805:-1,1806:-1,1807:-1,1808:-1,1809:-1,1810:-1,1811:-1,1812:-1
-    shop    Instruments    -1,1901:-1,1902:-1,1903:-1,1904:-1,1905:-1,1906:-1,1907:-1,1908:-1,1909:-1,1910:-1,1921:-1,1911:-1,1912:-1,1913:-1
-    shop    Whips    -1,1950:-1,1951:-1,1952:-1,1953:-1,1954:-1,1955:-1,1956:-1,1957:-1,1958:-1,1959:-1,1960:-1,1961:-1,1963:-1
-    shop    Books    -1,1550:-1,1551:-1,1552:-1,1553:-1,1568:-1,1554:-1,1569:-1,1570:-1,1556:-1,1571:-1,1557:-1,1578:-1
-    shop    Guns    -1,13102:-1,13103:-1,13150:-1,13151:-1,13152:-1,13163:-1,13164:-1,13165:-1,13166:-1,13154:-1,13155:-1,13168:-1,13169:-1
-    shop    Huuma and Kunai    -1,13010:-1,13011:-1,13007:-1,13008:-1,13012:-1,13013:-1,13006:-1,13300:-1,13301:-1,13302:-1,13303:-1,13311:-1,13313:-1,13314:-1,13315:-1,13312:-1
-    shop    Katars    -1,1250:-1,1251:-1,1252:-1,1253:-1,1254:-1,1255:-1

I love the AnnieRuru way :D

Edit @Annie:

You define .@job at the begenning but never used it ? Should be .menu$[.@job] ?

Isn't it better to, instead of having your switch, just do a "set .@job, BaseClass;" and remove after what you don't want ?

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

@KeyWorld: You still use .gat? xD

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

@KeyWorld: You still use .gat? xD

i just copy the header from the base npc at topic #1 :)
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

@Annie:

Try never to use continue; script function. It's odd and pretty bad. I believe it works exactly as in C or C++, and that command was used to refresh the heap scrolling it from start to end, just to say "let the script continue", and that is actually pretty useless, it just helps to slow down the compiler.

not that a friend of mine was even Fired from his ex agency for using it into a serial script... odd but true D:

@Key:

Is really rA system so bad that never implemented an enumeration? ._.

Well, I could expect it from something it doesn't even have floats xD

Edited by Ryokem
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

Funny thing, I did the same than Euphy... but mine is easier to edit :P

prt_in.gat,172,140,3	script	Weapons Shop	951,{
function enum;


switch( BaseJob ) {
	case Job_Priest:	 setarray .@priority, .TYPE_MACE, .TYPE_WAND, .TYPE_BOOK, .TYPE_KNUCKLE; break;
	case Job_Assassin:   setarray .@priority, .TYPE_DAGGER, .TYPE_KATAR, .TYPE_SWORD; break;
	case Job_Monk:	   setarray .@priority, .TYPE_MACE, .TYPE_KNUCKLE; break;
	case Job_Sage:	   setarray .@priority, .TYPE_WAND, .TYPE_BOOK; break;
	case Job_Rogue:	  setarray .@priority, .TYPE_DAGGER, .TYPE_SWORD, .TYPE_BOW; break;
	case Job_Bard:	   setarray .@priority, .TYPE_BOW, .TYPE_INSTRUMENT, .TYPE_DAGGER; break;
	case Job_Dancer:	 setarray .@priority, .TYPE_BOW, .TYPE_WHIP, .TYPE_DAGGER; break;
	case Job_Gunslinger: setarray .@priority, .TYPE_GUN; break;
	case Job_Ninja:	  setarray .@priority, .TYPE_KUNAI; break;

	// Base class, if not in list
	default:
		switch( BaseClass ) {
			case Job_Novice:   setarray .@priority, .TYPE_DAGGER, .TYPE_SWORD; break;
			case Job_Swordman: setarray .@priority, .TYPE_SWORD, .TYPE_SPEAR;  break;
			case Job_Mage:	 setarray .@priority, .TYPE_WAND; break;
			case Job_Archer:   setarray .@priority, .TYPE_BOW; break;
			case Job_Acolyte:  setarray .@priority, .TYPE_MACE, .TYPE_WAND; break;
			case Job_Merchant: setarray .@priority, .TYPE_AXE, .TYPE_DAGGER, .TYPE_MACE, .TYPE_SWORD; break;
			case Job_Thief:	setarray .@priority, .TYPE_DAGGER, .TYPE_BOW; break;
		}
}


set .@size, getarraysize(.@priority);

// Priority menu
if ( .@size ) {
	for (set .@menu$, "^FF0000"; .@i<.@size; set .@i, .@i + 1 ) {
		set .@type, .@priority[.@i];
		set .@menu$, .@menu$ + ( .@i ? ":" : "") + .TYPE_NAME$[.@type];
		set .@list[.@i], .@type;
		set .@types[.@type], 1;
	}
}

// Other menu
for ( set .@menu$, .@menu$ + "^0000FF"; .@j<.TYPE_MAX; set .@j, .@j + 1 )
	if ( !.@types[.@j] ) {
		set .@menu$, .@menu$ + ( .@size+.@j ? ":" : "" ) + .TYPE_NAME$[.@j];
		set .@types[.@j], 1;
		set .@list[.@size+.@j], .@j;
	}
}

// Display menu
callshop .TYPE_NAME$[ .@list[select(.@menu$) - 1] ];
close;


OnInit:

// Constantes
enum(
	.TYPE_DAGGER,
	.TYPE_SWORD,
	.TYPE_SPEAR,
	.TYPE_AXE,
	.TYPE_MACE,
	.TYPE_WAND,
	.TYPE_BOW,
	.TYPE_KNUCKLE,
	.TYPE_INSTRUMENT,
	.TYPE_WHIP,
	.TYPE_BOOK,
	.TYPE_GUN,
	.TYPE_KUNAI,
	.TYPE_KATAR,
	.TYPE_MAX
);

// Define name base on constantes
set .TYPE_NAME$[.TYPE_DAGGER],	 "Daggers";
set .TYPE_NAME$[.TYPE_SWORD],	  "Swords";
set .TYPE_NAME$[.TYPE_SPEAR],	  "Spears";
set .TYPE_NAME$[.TYPE_AXE],		"Axes";
set .TYPE_NAME$[.TYPE_MACE],	   "Maces";
set .TYPE_NAME$[.TYPE_WAND],	   "Wands";
set .TYPE_NAME$[.TYPE_BOW],		"Bows";
set .TYPE_NAME$[.TYPE_KNUCKLE],	"Knuckles";
set .TYPE_NAME$[.TYPE_INSTRUMENT], "Instruments";
set .TYPE_NAME$[.TYPE_WHIP],	   "Whips";
set .TYPE_NAME$[.TYPE_BOOK],	   "Books";
set .TYPE_NAME$[.TYPE_GUN],		"Guns";
set .TYPE_NAME$[.TYPE_KUNAI],	  "Huuma and Kunai";
set .TYPE_NAME$[.TYPE_KATAR],	  "Katars";

// Enum functions
function enum {
	for ( set .@size, getargcount(); .@i<.@size; set .@i, .@i+1 )
		set getarg(.@i), .@i;
}
}

-	shop	Daggers	-1,1203:-1,1201:-1,1202:-1,1206:-1,1204:-1,1205:-1,1209:-1,1207:-1,1208:-1,1212:-1,1210:-1,1211:-1,1215:-1,1213:-1,1214:-1,1218:-1,1216:-1,1217:-1,1221:-1,1219:-1,1220:-1,1222:-1,1226:-1,1245:-1,1246:-1,1247:-1,1248:-1,1249:-1,13000:-1,13003:-1,13004:-1
-	shop	Swords	-1,1103:-1,1101:-1,1102:-1,1106:-1,1104:-1,1105:-1,1109:-1,1107:-1,1108:-1,1112:-1,1110:-1,1111:-1,1113:-1,1114:-1,1121:-1,1119:-1,1120:-1,1122:-1,1125:-1,1123:-1,1128:-1,1126:-1,1127:-1,1129:-1,1149:-1,1146:-1,1147:-1,1118:-1,1116:-1,1117:-1,1153:-1,1151:-1,1152:-1,1156:-1,1154:-1,1155:-1,1159:-1,1157:-1,1158:-1,1160:-1,1162:-1,1163:-1,31172:-1,1172:-1
-	shop	Spears	-1,1403:-1,1401:-1,1402:-1,1406:-1,1404:-1,1405:-1,1409:-1,1407:-1,1408:-1,1411:-1,1453:-1,1451:-1,1452:-1,1456:-1,1454:-1,1455:-1,1459:-1,1457:-1,1458:-1,1462:-1,1460:-1,1461:-1,1465:-1,1463:-1,1464:-1
-	shop	Axes	-1,1303:-1,1301:-1,1302:-1,1353:-1,1351:-1,1352:-1,1356:-1,1354:-1,1355:-1,1359:-1,1357:-1,1358:-1,1362:-1,1360:-1,1361:-1
-	shop	Maces	-1,1503:-1,1501:-1,1502:-1,1506:-1,1504:-1,1505:-1,1509:-1,1507:-1,1508:-1,1512:-1,1510:-1,1511:-1,1519:-1,1520:-1,1521:-1,1513:-1,1514:-1,1515:-1,1516:-1,1517:-1,1518:-1,1522:-1,1532:-1
-	shop	Wands	-1,1603:-1,1601:-1,1602:-1,1606:-1,1604:-1,1605:-1,1609:-1,1607:-1,1608:-1,1612:-1,1610:-1,1611:-1,1617:-1,1618:-1,1619:-1,1620:-1
-	shop	Bows	-1,1703:-1,1701:-1,1702:-1,1706:-1,1704:-1,1705:-1,1709:-1,1707:-1,1708:-1,1712:-1,1710:-1,1711:-1,1713:-1,1715:-1,1714:-1,1716:-1,1726:-1,1721:-1
-	shop	Knuckles	-1,1801:-1,1802:-1,1803:-1,1804:-1,1805:-1,1806:-1,1807:-1,1808:-1,1809:-1,1810:-1,1811:-1,1812:-1
-	shop	Instruments	-1,1901:-1,1902:-1,1903:-1,1904:-1,1905:-1,1906:-1,1907:-1,1908:-1,1909:-1,1910:-1,1921:-1,1911:-1,1912:-1,1913:-1
-	shop	Whips	-1,1950:-1,1951:-1,1952:-1,1953:-1,1954:-1,1955:-1,1956:-1,1957:-1,1958:-1,1959:-1,1960:-1,1961:-1,1963:-1
-	shop	Books	-1,1550:-1,1551:-1,1552:-1,1553:-1,1568:-1,1554:-1,1569:-1,1570:-1,1556:-1,1571:-1,1557:-1,1578:-1
-	shop	Guns	-1,13102:-1,13103:-1,13150:-1,13151:-1,13152:-1,13163:-1,13164:-1,13165:-1,13166:-1,13154:-1,13155:-1,13168:-1,13169:-1
-	shop	Huuma and Kunai	-1,13010:-1,13011:-1,13007:-1,13008:-1,13012:-1,13013:-1,13006:-1,13300:-1,13301:-1,13302:-1,13303:-1,13311:-1,13313:-1,13314:-1,13315:-1,13312:-1
-	shop	Katars	-1,1250:-1,1251:-1,1252:-1,1253:-1,1254:-1,1255:-1

I love the AnnieRuru way :D

Edit @Annie:

You define .@job at the begenning but never used it ? Should be .menu$[.@job] ?

Isn't it better to, instead of having your switch, just do a "set .@job, BaseClass;" and remove after what you don't want ?

nvHJ7.jpg

I just want to try.. xD

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  379
  • Reputation:   304
  • Joined:  11/10/11
  • Last Seen:  

I just want to try.. xD
Comment the line, or add a "{" after the for(). Yeah I didn't test the script :P
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

more tricks XD

prontera,156,184,4	script	ksdjfhskhfj	100,{
mes "blah";
.@job = getd( ".job"+ basejob ); // note : if basejob is out of range, will default to novice because its 0
.@s = select( .menu$[ .@job ] ) -1;
close2;
//	callshop "weapon_shop#"+ getd( ".weaponselect"+ getd( ".job"+ basejob ) +"["+ .@s +"]" ), 1; // PS: ... seen this in my mission board script ? XD
callshop "weapon_shop#"+ getd( ".weaponselect"+ .@job +"["+ .@s +"]" ), 1; // EDITED : optimized a little bit
end;
OnInit:
setd ".job"+ Job_Novice, 0;
setd ".job"+ Job_SuperNovice, 0;
setd ".job"+ Job_Swordman, 1;
setd ".job"+ Job_Mage, 2;
setd ".job"+ Job_Archer, 3;
setd ".job"+ Job_Acolyte, 4;
setd ".job"+ Job_Merchant, 5;
setd ".job"+ Job_Thief, 6;
setd ".job"+ Job_Knight, 7;
setd ".job"+ Job_Priest, 8;
setd ".job"+ Job_Wizard, 9;
setd ".job"+ Job_Blacksmith, 10;
setd ".job"+ Job_Hunter, 11;
setd ".job"+ Job_Assassin, 12;
setd ".job"+ Job_Crusader, 14;
setd ".job"+ Job_Monk, 15;
setd ".job"+ Job_Sage, 16;
setd ".job"+ Job_Rogue, 17;
setd ".job"+ Job_Alchemist, 18;
setd ".job"+ Job_Bard, 19;
setd ".job"+ Job_Dancer, 19;
setd ".job"+ Job_Taekwon, 21;
setd ".job"+ Job_Star_Gladiator, 22;
setd ".job"+ Job_Soul_Linker, 23;
setd ".job"+ Job_Gunslinger, 24;
setd ".job"+ Job_Ninja, 25;
setarray .@weaponname$[1],
	"Daggers",
	"One-handed swords",
	"Two-handed swords",
	"One-handed spears",
	"Two-handed spears",
	"One-handed axes",
	"Two-handed axes",
	"Maces",
	"", // <-- stupid unused
	"Staves",
	"Bows",
	"Knuckles",
	"Musical Instruments",
	"Whips",
	"Books",
	"Katars",
	"Revolvers",
	"Rifles",
	"Gatling guns",
	"Shotguns",
	"Grenade launchers",
	"Fuuma Shurikens",
	"Two-handed staves";
// select hex( sum(aaa) ) from ( select 1 << view as aaa from item_db where type = 4 && equip_jobs & 1<<0 group by view ) as zzz;
setarray .@weaponbits,
	0x54E, // 0 novice
	0x1FE, // 1 swordsman
	0x80050A, // 2 mage
	0x90A, // 3 archer
	0x80050A, // 4 acolyte
	0x1CE, // 5 merchant
	0x94E, // 6 thief
	0x1FE, // 7 knight
	0x80950A, // 8 priest
	0x80050A, // 9 wizard
	0x1CE, // 10 blacksmith
	0x90A, // 11 hunter
	0x1014E, // 12 assassin
	-1, // 13 unused
	0x1FE, // 14 crusader
	0x80150A, // 15 monk
	0x80850A, // 16 sage
	0x94E, // 17 rogue
	0x1CE, // 18 alchemist
	0x690A, // 19 barddancer
	-1, // 20 unused
	0x10A, // 21 taekwon
	0x810A, // 22 star gladiator
	0x80050A, // 23 soul linker
	0x3E010A, // 24 gunslinger
	0x40010A; // 25 ninja
freeloop 1;
.@i = 0;
while ( .@i <= 25 ) { // job index
	if ( .@i != 13 && .@i != 20 ) { // unused
		.@j = 1;
		.@c1 = .@c2 = 0;
		while ( .@j <= 22 ) { // weapon index
			if ( .@j != 9 ) {
				if ( .@weaponbits[.@i] & 1 << .@j ) {
					.menu$[.@i] = .menu$[.@i] +"^00CC00"+ .@weaponname$[.@j] +":";
					setd ".weaponselect"+ .@i +"["+ .@c1 +"]", .@j;
					.@c1++;
				}
				else {
					.@menu$[.@i] = .@menu$[.@i] +"^FF0000"+ .@weaponname$[.@j] +":";
					setd ".@weaponselect"+ .@i +"["+ .@c2 +"]", .@j;
					.@c2++;
				}
			}
			.@j++;
		}
		.menu$[.@i] = .menu$[.@i] + .@menu$[.@i];
		copyarray getd( ".weaponselect"+ .@i +"["+ .@c1 +"]" ), getd( ".@weaponselect"+ .@i ), .@c2;
	}
	.@i++;
}
.@i = 1;
while ( .@i <= 22 ){ // weapon shops
	.@nb = query_sql( "select id from item_db where type = 4 && view = "+ .@i +" limit 128", .@id );
	npcshopdelitem "weapon_shop#"+ .@i, 501;
	.@j = 0;
	while ( .@j < .@nb ) {
		npcshopadditem "weapon_shop#"+ .@i, .@id[.@j], getiteminfo( .@id[.@j], 0 );
		.@j++;
	}
	.@i++;
}
freeloop 0;
end;
}
-	shop	weapon_shop#1	-1,501:1000
-	shop	weapon_shop#2	-1,501:1000
-	shop	weapon_shop#3	-1,501:1000
-	shop	weapon_shop#4	-1,501:1000
-	shop	weapon_shop#5	-1,501:1000
-	shop	weapon_shop#6	-1,501:1000
-	shop	weapon_shop#7	-1,501:1000
-	shop	weapon_shop#8	-1,501:1000
-	shop	weapon_shop#10	-1,501:1000
-	shop	weapon_shop#11	-1,501:1000
-	shop	weapon_shop#12	-1,501:1000
-	shop	weapon_shop#13	-1,501:1000
-	shop	weapon_shop#14	-1,501:1000
-	shop	weapon_shop#15	-1,501:1000
-	shop	weapon_shop#16	-1,501:1000
-	shop	weapon_shop#17	-1,501:1000
-	shop	weapon_shop#18	-1,501:1000
-	shop	weapon_shop#19	-1,501:1000
-	shop	weapon_shop#20	-1,501:1000
-	shop	weapon_shop#21	-1,501:1000
-	shop	weapon_shop#22	-1,501:1000
 

1.

after browse through euphy and emistry script ... only I realize I forgot to make available weapon selection to top of the menu as green ...

so I split them out into 2 dimension array ... then crunch them with copyarray

2.

hint: ... I completely rewrite from yours because my script is based on doc\item_db.txt documentation

3.

yeah I also same as @ToastOfDoom prefer to move calculations to server startup

so when accessing this script, the server will do as few calculations as possible

EDITED:

@keyworld

yeah I also realized that later on ... though before you post that though

for 2 days my internet connection is unstable ... now ok a bit ... but still slow sometimes

 

EDIT on 19/April/2018

http://upaste.me/1879496403dd64bde

might as well update this a little bit, though I don't think its good idea to bump such old topic since the topic starter has already inactive

Edited by AnnieRuru
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   19
  • Joined:  09/27/12
  • Last Seen:  

HOLY REPLIES BATMAN...!

Euphy:

No Euphy, I use .gat. XD

Dunno why... old habits die hard I guess. Like I want my scripts to be backwards "compatible" or some crap (in my mind...). Although a script I wrote requires .gat to be added... because checking the existing map name returns a value that has .gat attached. Wooo... should that be a bug?

Thanks for the comments! The only part I still wanted to ask about to make sure I'm understanding is the use of .@j. And I understand the bit usage; but that basically means that there can't ever be more than 32 shops. =P I think that's okay though... lol. Also, clever use of loops and "!" there, with the bit, very cool.

Anyway, for .@j, this:

// Store shop number in an array.
set .@j[getarraysize(.@j)], .@i+1;
...
// Call shop based on menu option selected.
//   select(.@menu$)-1 : returns menu array element.
//   .@j[]-1 : array element in relation to .Shops$ array.
//   .Shops$[] : stores shop names.
callshop .Shops$[.@j[select(.@menu$)-1]-1],1;

Since you are taking -1 away from .@j when it is called, why must you add +1 to .@i in the loop? And how can getarraysize() return an array index that hasn't been made yet? I'm assuming it is used here to return a value equal to the loop so everything can be uniform. Wait, does it return the array size in +1 values? So an array with only a "0" index would be size 1? Then that makes perfect sense and is awesome.

Otherwise, essentially what .@j is doing in the callshop line is pointing to the index of the appropriate shop name, since they don't change in order? The last loop in the function skips numbers if they are true. So .@j's job is to simply point to the appropriate string name of the shop. Do I have that right?

Emistry:

But how does the value of .@shop_list[0] being equal to or less than .@i determine the shop color? What if we want the first shop in the array to be red (AKA, Daggers)?

Annie:

Nope, still lost. XD

Everyone Else:

Thanks so much for all your comments and help! I'm glad everyone got so interested. =P

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  2
  • Reputation:   0
  • Joined:  12/10/12
  • Last Seen:  

It looks very complicated. But dont worry AnnieRuru is there :))

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Since you are taking -1 away from .@j when it is called, why must you add +1 to .@i in the loop?

I added a comment on that in the first loop xD.

// Has +1 to prevent skipping an element if 0 is passed (subtract 1 later).

In an int array, blank elements are identical to zeros (in strings, they are ""). Ending zeros don't count towards array size, and since I started numbering the shops at 0, the +/- is there to prevent an array size issue.

And how can getarraysize() return an array index that hasn't been made yet? I'm assuming it is used here to return a value equal to the loop so everything can be uniform. Wait, does it return the array size in +1 values? So an array with only a "0" index would be size 1?

Don't know what you mean by "+1 values". Arrays start at index 0, so getarraysize() of an array that doesn't exist (e.g. has all zeros) will return 0.

Otherwise, essentially what .@j is doing in the callshop line is pointing to the index of the appropriate shop name, since they don't change in order? The last loop in the function skips numbers if they are true. So .@j's job is to simply point to the appropriate string name of the shop. Do I have that right?

Correct, .@j[] stores the index of the original shop name.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   19
  • Joined:  09/27/12
  • Last Seen:  

My apologies to everyone for my delay in responding. I have been having computer troubles and therefore only had access to this forum via mobile devices (no code to look at).

That's pretty awesome, thank you Euphy. The part I was talking about with getarraysize() is what it returns for an array that doesn't exist, but you increased the value for the menu later in the script (since menus start at 1). So, that worked out. Although I think in order to compensate for that I'll start all the store arrays at 1 instead of 0 just to save the modifier later.

Thanks everyone! I am probably going to go with Euphy's afterall because it allows me the easiest time making sub-menus (because the function can just be slightly modified to be called "when ready").

Link to comment
Share on other sites

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.

×
×
  • Create New...