What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

[PB] Make Random Glyph Code Help

kbrebel04

New Member
Joined
Dec 15, 2011
Messages
294
Reaction score
3
Below I have listed a script I will be using to make a specific glyph. What do i need to change/add in here in order for it to make random glyphs(until out of resources to do so) from a list of glpyhs I provide?

I would rather have a bunch of randoms then 50 of 1 glyph if possible...

Code:
      <!-- Glyph of Colossus Smash -->
      <CustomAction Code="Log(&quot;[ProfessionBuddy] Crafting Glyph of Colossus.&quot;);" />
      <While Condition="InbagCount(61978) &gt; 3" IgnoreCanRun="True">
        <If Condition="Me.FreeBagSlots == 0" IgnoreCanRun="True">
        <CallSubRoutine SubRoutineName="SendMail" />
        </If>
        <CallSubRoutine SubRoutineName="BuyCommonParchment" />
        <CastSpellAction RepeatType="Specific" Repeat="1" Entry="89815" CastOnItem="False" ItemType="Chest" ItemId="0" />
      </While>
 
Come on guys this is going to drive me NUTS. This script below WORKS for 1 glyph. I want it to make random glyphs from the spell numbers i enter in the area highlighted in red. If i put 1 spell it works, if i put 2+ seperated by commas it does not. People would use this same script to create random gems(bold, delicate etc). Help me please
Code:
      <!-- Glyphs -->
      <CustomAction Code="Log(&quot;[ProfessionBuddy] Crafting Glyphs.&quot;);" />
      <While Condition="InbagCount(43126) &gt; 3" IgnoreCanRun="True">
        <CastSpellAction RepeatType="Specific" Repeat="1" Entry=[COLOR="#FF0000"]"62162"[/COLOR] CastOnItem="False" ItemType="Chest" ItemId="0" />
      </While>
 
Have you tried to change the "RepeatType to "Random" or something ?
 
this probaly won't help but if u try to make it as pseudo code it would be smth like

while (1) // (endless loop / repeat)
int genNr = generate_randomNrbetween(a-d);

if (genNr==a){make this glyph}
if (genNr==b){make this glyph}
if (genNr==c){make this glyph}
if (genNr==d){make this glyph}

if(outOfMats) { end }

repeat

just a thought.. but theres proablly a simpler way
 
this probaly won't help but if u try to make it as pseudo code it would be smth like

while (1) // (endless loop / repeat)
int genNr = generate_randomNrbetween(a-d);

if (genNr==a){make this glyph}
if (genNr==b){make this glyph}
if (genNr==c){make this glyph}
if (genNr==d){make this glyph}

if(outOfMats) { end }

repeat

just a thought.. but theres proablly a simpler way

If you(The OP) looks at the multiprofile, this is pretty much how it chooses which zone it will farm if random is marked, so just rewriting it for Glyphs should be possible. (Dunno if it would be easy or not, but you should give it a try.)
 
Hope this helps someone
Code:
  <Settings DefaultValue="0" Type="UInt32" Name="Glyph" Summary="Do Not Edit" Category="Misc" Global="False" Hidden="True"/>
  <Declaration Code="List&lt;uint&gt; GlyphIDs;" />
  <CustomAction Code="GlyphIDs = new List&lt;uint&gt;();" />
  <CustomAction Code="GlyphIDs.Add(62162);"/>
  <CustomAction Code="GlyphIDs.Add(62164);"/>
  <CustomAction Code="int Glyph = 0;
  Random r = new Random();
  int index = GlyphIDs.IndexOf((uint)Settings[&quot;Glyph&quot;]);
  do
  {
    Glyph=r.Next(0, GlyphIDs.Count);
  }
  while ( Glyph == index); 
Settings[&quot;Glyph&quot;] =  GlyphIDs[Glyph];" />
  <If Condition="(uint)Settings[&quot;Glyph&quot;] == 62162" IgnoreCanRun="True">
<!-- Glyphs -->
    <CustomAction Code="Log(&quot;[ProfessionBuddy] Crafting Glyphs.&quot;);" />
    <While Condition="InbagCount(43126) &gt; 3" IgnoreCanRun="True">
      <CastSpellAction RepeatType="Specific" Repeat="1" Entry="62162" CastOnItem="False" ItemType="Chest" ItemId="0"/>
    </While>
  </If>
NOT TESTED
 
Back
Top