From: Wildern t. S. <tim...@ya...> - 2002-04-26 13:56:22
|
It looks like this list does not support attachments, and Yahoo limits the size of the body of the email (I cannot paste in all of Script.java) This is exceedingly ugly, but, for now, I will just paste in relevant portions of the code. If anyone has any better ideas for the future, let me know. Wildern ######### Script.java *Lee Templeton Converted the code to match the new schema 4/10/2002 *Wildern Fixed parse error in runScript regarding " 4/25/2002 *Wildern Fixed string variable bug 4/25/2002 *Wildern Fixed bug relating to enemy,following,pet keywords 4/25/2002 *Wildern Fixed bugs relating to createmob and createoneusemob 4/25/2002 *Wildern Added "clan" (works same as name, but returns clan) 4/25/2002 *Wildern Added "count" returns number of item carried 4/25/2002 ######## Function - void runScript(String strParams) strStore2 = strParams.substring(0, i2); } } varVariables.addVariable("param"+i, strStore2); // begin code added by Wildern if (i2 >= strParams.length()) { strParams = ""; } else { strParams = strParams.substring(i2+1); } // end code added by Wildern } }catch(Exception e) ####### Function - String getStringForCompile() if (strStore.equalsIgnoreCase("name")) { return "name " + getStringForCompile(); } // begin code added by Wildern if (strStore.equalsIgnoreCase("enemy")) { return "enemy " + getStringForCompile(); } if (strStore.equalsIgnoreCase("following")) { return "following " + getStringForCompile(); } if (strStore.equalsIgnoreCase("pet")) { return "pet " + getStringForCompile(); } if (strStore.equalsIgnoreCase("clan")) { return "clan " + getStringForCompile(); } // end code added by Wildern ####### Function - String getString() if (strStore.equalsIgnoreCase("name")) { LivingThing thnStore = getLivingThing(getString()); if (thnStore != null) { return thnStore.strName; } return "name"; } // begin code added by Wildern if (strStore.equalsIgnoreCase("clan")) { LivingThing thnStore = getLivingThing(getString()); if (thnStore != null) { return thnStore.strClan; } return "clan"; } // end code added by Wildern ###### Function - boolean parseScriptForCompile(RandomAccessFile rafCompile) }else if (strStore.equalsIgnoreCase("string")) { rafCompile.writeByte(19); // begin code by Wildern rafCompile.writeBytes(readScriptForCompile()+" "); rafCompile.writeBytes(getStringForCompile()); // end code by Wildern return true; }else if (strStore.equalsIgnoreCase("or")) ###### Function - boolean parseScript() case 29: { Mob mobStore = new Mob(getString(),(int)parseValue(),(int)parseValue(),engGame); // begin code added by Wildern engGame.vctMobs.addElement(mobStore); engGame.addDuskObject(mobStore); // end code added by Wildern return true; } case 30: { Mob mobStore = new Mob(getString(),(int)parseValue(),(int)parseValue(),engGame); mobStore.blnOneUse = true; // begin code added by Wildern engGame.vctMobs.addElement(mobStore); engGame.addDuskObject(mobStore); // end code added by Wildern return true; } ###### Function - private double parseValue() // begin code added by Wildern if (strStore.equalsIgnoreCase("count")) { String strStore2 = getString(); Item itmStore; int i=0, total=0; for (i=0;i<target.items.size();i++) { itmStore = (Item)target.items.elementAt(i); if (itmStore.strName.equalsIgnoreCase(strStore2)) { total++; } } return total; } // end code added by Wildern return (target.attributes.getStat(strStore)); ######### VariableSet.java ###### Function - void addVariable(String strName, Object objIn) void addVariable(String strName, Object objIn) { if (strName.equalsIgnoreCase("name") // begin code added by Wildern || strName.equalsIgnoreCase("clan") // end code added by Wildern || strName.equalsIgnoreCase("concat")) { Log.logError(new Exception(), "Error: You cannot create a variable with the name \""+strName+"\"."); __________________________________________________ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/ |