Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Raptor2213
Beginner


Joined: 03 Dec 2010
Posts: 11

PostPosted: Fri Jan 21, 2011 2:42 pm   

Calling a variable ...variable. need some help please. (Resolved)
 
If a mod should happen to see this, please move it to the zMUD section, thanks.


I'm working on an extra complicated script.


Basically, the MUD I play has a HUGE list of things, like this:

Gold: value 465ig/ton Spread: 15% Stock: current 3080/min 100/max 3124 Efficiency: 105%
Nickel: value 279ig/ton Spread: 15% Stock: current 2200/min 100/max 2268 Efficiency: 105%

(only much longer)



My trigger:
(%w): value (%2)ig/ton Spread: (%4)~% Stock: current (%6)/min (%8)/max (%10) Efficiency: (%12)~%

(The higher numbers are because for some reason it makes two entries for every numerical entry)


Anyway, I can use this function:
#var %1"stock" %6

To create/update a variable based off the name of the commodity shown above (in this case, it would create either @Goldstock or @Nickelstock).

The question is this. How can I CALL this variable, in an IF statement, without having to have 30+ if statements for each commod.
@"%1"stock does not seem to work, but I'm sure its because I don't know the proper characters to use for this.


Last edited by Raptor2213 on Wed Feb 02, 2011 1:51 am; edited 2 times in total
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Jan 21, 2011 2:52 pm   
 
I think this might work: @{%1"stock"}

Two other points:
1) Don't use %2, %3, etc. in a trigger pattern. Use %d, %w, *, and other proper pattern wildcards. %2, %3, etc. should be used within the trigger value, but not in the pattern itself.

2) You might be better off using a dabatase variable rather than hundreds of individual variables. Something like:
stock = {gold=3080|nickel=2200}

Then you can find the stock of gold with: @stock.gold

If you are unsure how to set and use database variables, just ask!
Reply with quote
Raptor2213
Beginner


Joined: 03 Dec 2010
Posts: 11

PostPosted: Fri Jan 21, 2011 5:47 pm   
 
Thanks, I made it work, I should note though that I had to make a second entry for it to work with %int (just in case anyone else tries this).


Example
#var prodmod @{%1"production"}
#var setpile %int( %6 + (@prodmod * 2))


Also, there doesn't need to be a database for this particular function. The comods do not interact with each other at all. Its kinda a long story, and you'd have to know how the game works. Thanks though!
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Jan 21, 2011 8:14 pm   
 
Whether the commodities interact with each other has nothing to do with whether a database variable is useful for this data. I am not talking about a full database, just a database variable. A database variable is a standard Cmud variable which contains multiple key=value pairs. Individual values can be accessed by a standard dot notation (e.g. @varname.keyname) or with a function (e.g. %db(@varname,keyname) ). One variable could contain the entire list of stocks, and you could use %dbkeys(@varname) to see a list of which commodities are listed in the variable.

It is certainly not necessary to use a database variable, but it does seem perfectly suited to your needs if you are willing to learn about them. Just a suggestion--you can certainly manage without it.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Jan 21, 2011 8:17 pm   
 
Also, as far as using %int: I don't think the %int is necessary. The following should work fine:
#var setpile ( %6 + (@{%1"production"} * 2))

The parentheses will cause the expression to be calulated as a mathematical expression, and the @{} should work inside there.
Reply with quote
Raptor2213
Beginner


Joined: 03 Dec 2010
Posts: 11

PostPosted: Fri Jan 21, 2011 8:46 pm   
 
Rahab wrote:
Also, as far as using %int: I don't think the %int is necessary. The following should work fine:
#var setpile ( %6 + (@{%1"production"} * 2))

The parentheses will cause the expression to be calulated as a mathematical expression, and the @{} should work inside there.


My client hates it when I try that. Don't know why.
If you want to see exactly what is going on, take a look:

Here's what the mud gives me:
Code:
  Alloys: value 135ig/ton  Spread: 15%   Stock: current 3256/min 100/max 2896  Efficiency: 105%
  AntiMatter: value 371ig/ton  Spread: 15%   Stock: current 2380/min 100/max 2392  Efficiency: 100%
  Artifacts: value 824ig/ton  Spread: 15%   Stock: current 135/min 100/max 200  Efficiency: 100%
  BioChips: value 803ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  BioComponents: value 931ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Cereals: value 209ig/ton  Spread: 15%   Stock: current 2615/min 100/max 2677  Efficiency: 113%
  Clays: value 378ig/ton  Spread: 15%   Stock: current 2688/min 100/max 2758  Efficiency: 105%
  Clinics: value 556ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Controllers: value 539ig/ton  Spread: 15%   Stock: current 2440/min 100/max 2456  Efficiency: 100%
  Crystals: value 472ig/ton  Spread: 15%   Stock: current 3160/min 100/max 3220  Efficiency: 105%
  Droids: value 526ig/ton  Spread: 15%   Stock: current 2380/min 100/max 2392  Efficiency: 100%
  Electros: value 312ig/ton  Spread: 15%   Stock: current 183/min 100/max 2200  Efficiency: 100%
  Explosives: value 360ig/ton  Spread: 15%   Stock: current 2710/min 100/max 2744  Efficiency: 100%
  Firewalls: value 879ig/ton  Spread: 10%   Stock: current -305/min 100/max 200  Efficiency: 100%
  Fruit: value 316ig/ton  Spread: 15%   Stock: current 2688/min 100/max 2792  Efficiency: 113%
  Furs: value 508ig/ton  Spread: 15%   Stock: current 2758/min 100/max 2876  Efficiency: 113%
  Games: value 267ig/ton  Spread: 25%   Stock: current -126/min 100/max 200  Efficiency: 100%
  GAsChips: value 567ig/ton  Spread: 25%   Stock: current -147/min 100/max 200  Efficiency: 100%
  Generators: value 532ig/ton  Spread: 15%   Stock: current 3070/min 100/max 3128  Efficiency: 100%
  Gold: value 463ig/ton  Spread: 15%   Stock: current 2904/min 100/max 2948  Efficiency: 105%
  Hides: value 291ig/ton  Spread: 15%   Stock: current 2948/min 100/max 3002  Efficiency: 113%
  Holos: value 334ig/ton  Spread: 25%   Stock: current -203/min 100/max 200  Efficiency: 100%
  Hypnotapes: value 553ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Katydidics: value 746ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Laboratories: value 581ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  LanzariK: value 516ig/ton  Spread: 15%   Stock: current 2860/min 100/max 2904  Efficiency: 100%
  Lasers: value 587ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Libraries: value 824ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Livestock: value 160ig/ton  Spread: 15%   Stock: current 2948/min 100/max 3026  Efficiency: 113%
  LubOils: value 422ig/ton  Spread: 15%   Stock: current 2920/min 100/max 2968  Efficiency: 100%
  Meats: value 320ig/ton  Spread: 15%   Stock: current 2960/min 100/max 2998  Efficiency: 113%
  Mechparts: value 322ig/ton  Spread: 15%   Stock: current 2890/min 100/max 2936  Efficiency: 100%
  MicroScalpels: value 398ig/ton  Spread: 15%   Stock: current 180/min 100/max 2200  Efficiency: 100%
  Monopoles: value 545ig/ton  Spread: 15%   Stock: current 2488/min 100/max 2506  Efficiency: 105%
  Munitions: value 302ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Musiks: value 598ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  NanoFabrics: value 1051ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Nanos: value 680ig/ton  Spread: 25%   Stock: current -219/min 100/max 200  Efficiency: 100%
  Nickel: value 282ig/ton  Spread: 15%   Stock: current 3288/min 100/max 2506  Efficiency: 105%
  Nitros: value 292ig/ton  Spread: 25%   Stock: current -363/min 100/max 200  Efficiency: 100%
  Petrochemicals: value 303ig/ton  Spread: 15%   Stock: current 2744/min 100/max 2778  Efficiency: 105%
  Pharmaceuticals: value 771ig/ton  Spread: 25%   Stock: current -183/min 100/max 200  Efficiency: 100%
  Polymers: value 147ig/ton  Spread: 15%   Stock: current 2530/min 100/max 2552  Efficiency: 100%
  Powerpacks: value 526ig/ton  Spread: 15%   Stock: current 2350/min 100/max 2360  Efficiency: 100%
  Probes: value 643ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Propellants: value 195ig/ton  Spread: 15%   Stock: current 2350/min 100/max 2360  Efficiency: 100%
  Proteins: value 315ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Radioactives: value 681ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 105%
  RNA: value 470ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Semiconductors: value 254ig/ton  Spread: 15%   Stock: current 2658/min 100/max 2696  Efficiency: 105%
  Sensamps: value 663ig/ton  Spread: 25%   Stock: current -390/min 100/max 200  Efficiency: 100%
  Sensors: value 604ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Simulations: value 398ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Soya: value 281ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 113%
  Spices: value 795ig/ton  Spread: 25%   Stock: current -451/min 100/max 200  Efficiency: 113%
  Studios: value 491ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Synths: value 686ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Textiles: value 224ig/ton  Spread: 15%   Stock: current 3223/min 100/max 3383  Efficiency: 113%
  Tools: value 428ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  ToxicMunchers: value 575ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  TQuarks: value 1022ig/ton  Spread: 25%   Stock: current -147/min 100/max 200  Efficiency: 100%
  Tracers: value 735ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Univators: value 708ig/ton  Spread: 10%   Stock: current 35/min 100/max 200  Efficiency: 100%
  Vidicasters: value 282ig/ton  Spread: 15%   Stock: current 2490/min 100/max 2510  Efficiency: 100%
  Weapons: value 535ig/ton  Spread: 25%   Stock: current -525/min 100/max 200  Efficiency: 100%
  Woods: value 532ig/ton  Spread: 15%   Stock: current 487/min 100/max 501  Efficiency: 113%
  Xmetals: value 349ig/ton  Spread: 15%   Stock: current 398/min 100/max 410  Efficiency: 105%


Here's my trigger:
Code:
(%w): value (%2)ig/ton  Spread: (%4)~%   Stock: current (%6)/min (%8)/max (%10)  Efficiency: (%12)~%


Code:
#if (@{%1"stock"} < %8) {#var %1"stock" %6}
#if (%6 < %8) {
  #if (%4 <> 25) {#if (%1 <> Firewalls) {#if (%1 <> Univators) {set spread 25 %1}}}
  #if (%10 <> 200) {set stockpile max 200 %1}
  }
#if (%6 = %10) {#var %1"stock" %int( %6 + 1)}
#if (%6 <> @{%1"stock"}) {
  #if (%6 >= 3250) {
    #if (%10 = 20000) {
      #var setpile 2200
      set spread 40 %1
      }{
      #var setpile 20000
      set spread 40 %1
      }
    }
  #if (%6 < 3250) {
    #var prodmod @{%1"production"}
    #var setpile %int( %6 + (@prodmod * 2))
    #if (%4 <> 15) {set spread 15 %1}
    }
  set stockpile max @setpile %1
  }
#var %1"stock" %6


Basically, in the game, some things produce positivity, others negativity.
Whenever I pull down the numbers above, the script checks to see if it's a negative stock. If it is, it makes sure the max stock and spread (markup) is what I want it to be. Then it should take anything that's below 3250 and step it up by the 2x amount that's being produced every tic. Once it reaches the 3250 threshold, it should change the max stock to be 20k, and set the markup to 40% for one tic (until it's produced again). This jacks up the price. One the stock changes again, it then lower the max stock to 2200, and set the markup to 40%, in theory, selling ~1k of it at a good price, then producing again.

Still working on refining the code a bit, but that's the basics of it.


Last edited by Raptor2213 on Sat Jan 22, 2011 3:24 am; edited 1 time in total
Reply with quote
Raptor2213
Beginner


Joined: 03 Dec 2010
Posts: 11

PostPosted: Fri Jan 21, 2011 9:30 pm   
 
Or, I should say, still working on the code because it does random crap... >_<
(like executing commands to <set stockpile max <somewhere-between-2300and3000> comod>)

I'm kinda burnt out on it for today as well, I'll mess with it some more tomorrow when I'm fresh.



And by random crap, I mean like this:

Mud says:
Crystals: value 503ig/ton Spread: 15% Stock: current 3250/min 100/max 3280 Efficiency: 105%

Trigger enters this command:
set stockpile max 2555 Crystals
Reply with quote
Raptor2213
Beginner


Joined: 03 Dec 2010
Posts: 11

PostPosted: Sat Jan 22, 2011 3:40 am   
 
An analysis of the screen shows me the problem

Here is what was shown on-screen:
Clays: value 406ig/ton Spread: 15% Stock: current 2485/min 100/max 2520 Efficiency: 105%
set stockpile max 2555 Clays
Clinics: value 562ig/ton Spread: 25% Stock: current -525/min 100/max 200 Efficiency: 100%
Controllers: value 544ig/ton Spread: 15% Stock: current 2448/min 100/max 2464 Efficiency: 100%
Crystals: value 503ig/ton Spread: 15% Stock: current 3250/min 100/max 3280 Efficiency: 105%
set stockpile max 2555 Crystals

Text in blue was the client's input.

This indicates that what is happening is that, semi-randomly, the client is mixing variables up. Any ideas?
(Please tell me not a database, I looked at it once, got overwhelmed by it, couldn't find a manual, and gave up)

P.S.

This code works partially:
Code:
#gag 1
#var %1"stock" %4
#if (@autohaul = 1) {
  #if (%4 > 3250) {#var FudgeComod 1}
  #if (%8 = 20000) {#var FudgeComod 2}
  #if (%1 = Alloys) {set stockpile max %int( %4 + (@Alloysproduction * 2)) %1}
  #if (%1 = AntiMatter) {set stockpile max %int( %4 + (@AntiMatterproduction * 2)) %1}
  #if (%1 = Artifacts) {set stockpile max %int( %4 + (@Artifactsproduction * 2)) %1}
  #if (%1 = BioChips) {set stockpile max %int( %4 + (@BioChipsproduction * 2)) %1}
  #if (%1 = BioComponents) {set stockpile max %int( %4 + (@BioComponentsproduction * 2)) %1}
  #if (%1 = Cereals) {set stockpile max %int( %4 + (@Cerealsproduction * 2)) %1}
  #if (%1 = Clays) {set stockpile max %int( %4 + (@Claysproduction * 2)) %1}
  #if (%1 = Clinics) {set stockpile max %int( %4 + (@Clinicsproduction * 2)) %1}
  #if (%1 = Controllers) {set stockpile max %int( %4 + (@Controllersproduction * 2)) %1}
  #if (%1 = Crystals) {set stockpile max %int( %4 + (@Crystalsproduction * 2)) %1}
  #if (%1 = Droids) {set stockpile max %int( %4 + (@Droidsproduction * 2)) %1}
  #if (%1 = Electros) {set stockpile max %int( %4 + (@Elecrosproduction * 2)) %1}
  #if (%1 = Explosives) {set stockpile max %int( %4 + (@Explosivesproduction * 2)) %1}
  #if (%1 = Firewalls) {
    set stockpile max %int( %4 + (@Firewallssproduction * 2)) %1
    set spread 10 firewalls
    }
  #if (%1 = Fruit) {set stockpile max %int( %4 + (@Fruitproduction * 2)) %1}
  #if (%1 = Furs) {set stockpile max %int( %4 + (@Fursproduction * 2)) %1}
  #if (%1 = Games) {set stockpile max %int( %4 + (@Gamesproduction * 2)) %1}
  #if (%1 = GAsChips) {set stockpile max %int( %4 + (@GAsChipsproduction * 2)) %1}
  #if (%1 = Generators) {set stockpile max %int( %4 + (@Generatorsproduction * 2)) %1}
  #if (%1 = Gold) {set stockpile max %int( %4 + (@Goldproduction * 2)) %1}
  #if (%1 = Hides) {set stockpile max %int( %4 + (@Hidesproduction * 2)) %1}
  #if (%1 = Holos) {set stockpile max %int( %4 + (@Holosproduction * 2)) %1}
  #if (%1 = Hypnos) {set stockpile max %int( %4 + (@Hypnossproduction * 2)) %1}
  #if (%1 = Katydidics) {set stockpile max %int( %4 + (@Katydidicssproduction * 2)) %1}
  #if (%1 = Laboratories) {set stockpile max %int( %4 + (@Laboratoriesproduction * 2)) %1}
  #if (%1 = LanzariK) {set stockpile max %int( %4 + (@LanzariKproduction * 2)) %1}
  #if (%1 = Lasers) {set stockpile max %int( %4 + (@Lasersproduction * 2)) %1}
  #if (%1 = Libraries) {set stockpile max %int( %4 + (@Librariesproduction * 2)) %1}
  #if (%1 = Livestock) {set stockpile max %int( %4 + (@Livestockproduction * 2)) %1}
  #if (%1 = LubOils) {set stockpile max %int( %4 + (@LubOilsproduction * 2)) %1}
  #if (%1 = Meats) {set stockpile max %int( %4 + (@Meatsproduction * 2)) %1}
  #if (%1 = Mechparts) {set stockpile max %int( %4 + (@Mechpartsproduction * 2)) %1}
  #if (%1 = MicroScalpels) {set stockpile max %int( %4 + (@MicroScalpelsproduction * 2)) %1}
  #if (%1 = Monopoles) {set stockpile max %int( %4 + (@Monopolesproduction * 2)) %1}
  #if (%1 = Munitions) {set stockpile max %int( %4 + (@Munitionsproduction * 2)) %1}
  #if (%1 = Musiks) {set stockpile max %int( %4 + (@Musiksproduction * 2)) %1}
  #if (%1 = NanoFabrics) {set stockpile max %int( %4 + (@NanoFabricsproduction * 2)) %1}
  #if (%1 = Nanos) {set stockpile max %int( %4 + (@Nanosproduction * 2)) %1}
  #if (%1 = Nickel) {set stockpile max %int( %4 + (@Nickelproduction * 2)) %1}
  #if (%1 = Nitros) {set stockpile max %int( %4 + (@Nitrosproduction * 2)) %1}
  #if (%1 = Petrochemicals) {set stockpile max %int( %4 + (@Petrochemicalsproduction * 2)) %1}
  #if (%1 = Pharmaceuticals) {set stockpile max %int( %4 + (@Pharmaceuticalsproduction * 2)) %1}
  #if (%1 = Polymers) {set stockpile max %int( %4 + (@Polymersproduction * 2)) %1}
  #if (%1 = Powerpacks) {set stockpile max %int( %4 + (@Powerpacksproduction * 2)) %1}
  #if (%1 = Propellants) {set stockpile max %int( %4 + (@Propellantsproduction * 2)) %1}
  #if (%1 = Proteins) {set stockpile max %int( %4 + (@Proteinsproduction * 2)) %1}
  #if (%1 = Radioactives) {set stockpile max %int( %4 + (@Radioactivesproduction * 2)) %1}
  #if (%1 = RNA) {set stockpile max %int( %4 + (@RNAproduction * 2)) %1}
  #if (%1 = Semiconductors) {set stockpile max %int( %4 + (@Semiconductorsproduction * 2)) %1}
  #if (%1 = Sensamps) {set stockpile max %int( %4 + (@Sensampsproduction * 2)) %1}
  #if (%1 = Sensors) {set stockpile max %int( %4 + (@Simulationsproduction * 2)) %1}
  #if (%1 = Simulations) {set stockpile max %int( %4 + (@Simulationsproduction * 2)) %1}
  #if (%1 = Soya) {set stockpile max %int( %4 + (@Soyaproduction * 2)) %1}
  #if (%1 = Spices) {set stockpile max %int( %4 + (@Spicesproduction * 2)) %1}
  #if (%1 = Studios) {set stockpile max %int( %4 + (@Studiosproduction * 2)) %1}
  #if (%1 = Synths) {set stockpile max %int( %4 + (@Synthsproduction * 2)) %1}
  #if (%1 = Textiles) {set stockpile max %int( %4 + (@Textilesproduction * 2)) %1}
  #if (%1 = Tools) {set stockpile max %int( %4 + (@Toolsproduction * 2)) %1}
  #if (%1 = ToxicMunchers) {set stockpile max %int( %4 + (@ToxicMunchersproduction * 2)) %1}
  #if (%1 = TQuarks) {
    set stockpile max %int( %4 + (@TQuarksproduction * 2)) %1
    set spread 10 tquarks
    }
  #if (%1 = Tracers) {set stockpile max %int( %4 + (@Tracersproduction * 2)) %1}
  #if (%1 = Univators) {
    set stockpile max %int( %4 + (@Univatorsproduction * 2)) %1
    set spread 10 unis
    }
  #if (%1 = Vidicasters) {set stockpile max %int( %4 + (@Vidicastersproduction * 2)) %1}
  #if (%1 = Weapons) {set stockpile max %int( %4 + (@Weaponsproduction * 2)) %1}
  #if (%1 = Woods) {set stockpile max %int( %4 + (@Woodsproduction * 2)) %1}
  #if (%1 = Xmetals) {set stockpile max %int( %4 + (@Xmetalsproduction * 2)) %1}
  #if (%4 < %6) {set stockpile max %int( 200) %1}
  #if (@FudgeComod = 1) {set stockpile max 20000 %1}
  #if (@FudgeComod = 2) {
    set stockpile max 2200 %1
    set spread 40 %1
    }
  #var FudgeComod 0
  }


The problem with this one is that the 'tics' where the goods are produced is based off an unknown formula based off total number of players online, total numbers of players online of certain ranks, and possibly phases of a quasar. The hope was to streamline it (because the mud takes 500ms*#of commands entered). Also, I can't just set the max to 20k. The further away the max is from current, the more it costs to produce.

Other possible indicators of a problem.
The second, crappy code gags fine. The first code tosses out semi-random bits of lines (usually starting just after the % sign for spread) from the comod listing (shown above). Could the problem simply be with my trigger? I have noticed this:

Xmetals: value 508ig/ton Spread: 40% Stock: current 974/min 100/max 2200 Efficiency: 105%
going through
(%w): value (%2)ig/ton Spread: (%4)~% Stock: current (%6)/min (%8)/max (%10) Efficiency: (%12)~%
shows this in a test




Also, random bits:
Code:
current 2304/min 100/max 2408  Efficiency: 113%
nt 2272/min 100/max 2296  Efficiency: 100%
%   Stock: current -525/min 100/max 200  Efficiency: 100%

P.P.S. Same bits using this instead:
(%w): value (%2)ig/ton Spread: (%d)? Stock: current (%6)/min (%8)/max (%10) Efficiency: (%d)?
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Sat Jan 22, 2011 4:53 am   
 
You are using zmud?
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
Raptor2213
Beginner


Joined: 03 Dec 2010
Posts: 11

PostPosted: Sat Jan 22, 2011 3:28 pm   
 
Yes
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Sat Jan 22, 2011 4:12 pm   
 
This forum is for the newer CMUD client. Some of the things that have been suggested won't work in zMUD. A mod should probably move this to the zMUD General Discussion forum. Also you should state which version of zMUD you are using.
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
Raptor2213
Beginner


Joined: 03 Dec 2010
Posts: 11

PostPosted: Sat Jan 22, 2011 4:13 pm   
 
7.21

Also, whoops, clicked the wrong one there, sorry.
Reply with quote
Raptor2213
Beginner


Joined: 03 Dec 2010
Posts: 11

PostPosted: Sun Jan 23, 2011 5:27 pm   
 
Found a viable workaround. Thank you Fizgar for your assistance with the trigger.
What seemed to be happening is that the code would pull down a previous value for a variable for some unknown reason, so I defined them as 0 and 3250 at the end and did a couple of other refinements. Seems to work now.




Trigger:
Code:
(%w):%svalue%s(%d)ig~/ton%sSpread:%s(%d)~%%sStock:%scurrent%s(*)~/min%s(%d)~/max%s(%d)%sEfficiency:%s(%d)~%


Code:
#gag 1
#if (@{%1"stock"} < %5) {#var %1"stock" %4}
#if (%4 < %5) {
  #if (%3 <> 25) {#if (%1 <> Firewalls) {#if (%1 <> Univators) {set spread 25 %1}}}
  #if (%6 <> 200) {set stockpile max 200 %1}
  }
#if (%4 = %6) {#var %1"stock" %int( %4 + 1)}
#if (%4 <> @{%1"stock"}) {
  #if (%4 >= 3250) {
    #if (%6 = 20000) {
      #var setpile 2200
      set spread 40 %1
      }
    #if (%6 < 20000) {
      #var setpile 20000
      set spread 40 %1
      }
    }
  #if (%4 < 3250) {
    #var prodmod @{%1"production"}
    #var setpile %int( %4 + (@prodmod * 2))
    #if (%3 <> 15) {set spread 15 %1}
    }
  set stockpile max @setpile %1
  }
#var %1"stock" %4
#var setpile 3250
#var prodmod 0
#if (%1 = Xmetals) {
  #wait 50
  version
  }
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net