Page 3 of 4 FirstFirst 1 2 3 4 LastLast
Results 21 to 30 of 36

Thread: Vlad's Familiar Changing Frankenscript

  1. #21
    Senior Member VladYvhuce's Avatar
    Join Date
    Feb 2016
    Location
    Kansas
    Posts
    190

    Default

    Nope... It just sits, there looking nice, but won't change familiars for me.

  2. #22
    Senior Member VladYvhuce's Avatar
    Join Date
    Feb 2016
    Location
    Kansas
    Posts
    190

    Default

    Looks like you can use enthrone_familiar to do that. You can check your familiars weights, as well as the weight adjustment, to figure out when to shift them, so...
    Originally Posted by Theraze View Post
    Nope. enthrone only works with a crown of thrones, not a bjorn.

    Edit: bjornify_familiar and my_bjorned_familiar work. But I still can't get the weight checking to work with the nice, neat listing function that my "change when the familiar reaches its drop limit" scripts use. I've had to go back to my archaic original design to get the script to work.
    Last edited by VladYvhuce; 03-30-2017 at 04:56 AM. Reason: Got it to work!
    In KOL: VladYvhuce (#1798867)

  3. #23

    Default

    Posting some code for people to critique might be more helpful than saying "I can't do it" repeatedly.

  4. #24
    Senior Member VladYvhuce's Avatar
    Join Date
    Feb 2016
    Location
    Kansas
    Posts
    190

    Default

    Sorry... I was assuming that people were keeping up with the script work. I can get a bit scatter-brained when I'm frustrated.

    This is the code that works:
    Code:
    void main ()
    //Familiars.
    	if (my_familiar() != $familiar[astral badger] && (familiar_weight($familiar[astral badger]) < 20)) 
    		use_familiar($familiar[astral badger]);
    	if (my_familiar() == $familiar[astral badger] && (familiar_weight($familiar[astral badger]) >= 20)) 
    		use_familiar($familiar[fist turkey]);
    	if (my_familiar() == $familiar[fist turkey] && (familiar_weight($familiar[fist turkey]) < 20)) 
    		use_familiar($familiar[fist turkey]);
    	if (my_familiar() == $familiar[fist turkey] && (familiar_weight($familiar[fist turkey]) >= 20)) 
    		use_familiar($familiar[space jellyfish]);
    	if (my_familiar() == $familiar[space jellyfish] && (familiar_weight($familiar[space jellyfish]) < 20)) 
    		use_familiar($familiar[space jellyfish]);
    	if (my_familiar() == $familiar[space jellyfish] && (familiar_weight($familiar[space jellyfish]) >= 20)) 
    		use_familiar($familiar[restless cow skull]);
    	if (my_familiar() == $familiar[restless cow skull] && (familiar_weight($familiar[restless cow skull]) < 20)) 
    		use_familiar($familiar[restless cow skull]);
    	if (my_familiar() == $familiar[restless cow skull] && (familiar_weight($familiar[restless cow skull]) >= 20)) 
    		use_familiar($familiar[baby sandworm]);
    	if (my_familiar() == $familiar[baby sandworm] && (familiar_weight($familiar[baby sandworm]) < 20)) 
    		use_familiar($familiar[baby sandworm]);
    	if (my_familiar() == $familiar[baby sandworm] && (familiar_weight($familiar[baby sandworm]) >= 20)) 
    		use_familiar($familiar[intergnat]);
    		
    //Bjorned Familiars
    	if (my_bjorned_familiar() != $familiar[galloping grill] && (familiar_weight($familiar[galloping grill]) < 20)) 
    		bjornify_familiar($familiar[galloping grill]);
    	if (my_bjorned_familiar() == $familiar[galloping grill] && (familiar_weight($familiar[galloping grill]) >= 20)) 
    		bjornify_familiar($familiar[li'l xenomorph]);
    	if (my_bjorned_familiar() == $familiar[li'l xenomorph] && (familiar_weight($familiar[li'l xenomorph]) < 20)) 
    		bjornify_familiar($familiar[machine elf]);
    	if (my_bjorned_familiar() == $familiar[machine elf] && (familiar_weight($familiar[machine elf]) >= 20)) 
    		bjornify_familiar($familiar[golden monkey]);
    	if (my_bjorned_familiar() == $familiar[golden monkey] && (familiar_weight($familiar[golden monkey]) < 20)) 
    		bjornify_familiar($familiar[bloovian groose]);
    	if (my_bjorned_familiar() == $familiar[bloovian groose] && (familiar_weight($familiar[bloovian groose]) >= 20)) 
    		bjornify_familiar($familiar[blavious kloop]);
    	if (my_bjorned_familiar() == $familiar[blavious kloop] && (familiar_weight($familiar[blavious kloop]) < 20)) 
    		bjornify_familiar($familiar[green pixie]);
    This is my working "item drop switch" code, which I can't figure out how to modify to get it to switch with weight:
    Code:
    cli_execute("checkpoint clear");
    
    familiar next_familiar() {
    	foreach f in $familiars[fist turkey, adventurous spelunker, machine elf, astral badger, baby sandworm, rogue program, green pixie, li'l xenomorph, llama lama, blavious kloop]
    		if (have_familiar(f) && f.drops_today < f.drops_limit)
    			return f;
    	if (have_familiar($familiar[intergnat])) return $familiar[intergnat];
    	return my_familiar();
    }
    
    void main() {
    	familiar next = next_familiar();
    	if (next != my_familiar()) use_familiar(next);
    }

  5. #25
    Senior Member Theraze's Avatar
    Join Date
    Mar 2010
    Posts
    8,656

    Default

    That is a TON of wasted server hits. Wouldn't it be easier to do something like:
    Code:
    boolean setfam = false;
    foreach f in $familars[astral badger, fist turkey, space jellyfish, restless cow skull, baby sandworm]
    {
    if (have_familiar(f) && familiar_weight(f) < 20)
    {
    if (my_familiar() != f) use_familiar(f);
    setfam = true;
    }
    }
    if (!setfam && have_familiar($familiar[intergnat] && my_familiar() != $familiar[intergnat]) use_familiar($familiar[intergnat]);

  6. #26
    Senior Member VladYvhuce's Avatar
    Join Date
    Feb 2016
    Location
    Kansas
    Posts
    190

    Default

    That is a TON of wasted server hits. Wouldn't it be easier to do something like:
    Code:
    boolean setfam = false;
    foreach f in $familars[astral badger, fist turkey, space jellyfish, restless cow skull, baby sandworm]
    {
    if (have_familiar(f) && familiar_weight(f) < 20)
    {
    if (my_familiar() != f) use_familiar(f);
    setfam = true;
    }
    }
    if (!setfam && have_familiar($familiar[intergnat] && my_familiar() != $familiar[intergnat]) use_familiar($familiar[intergnat]);
    Originally Posted by Theraze View Post
    If that'll get the job done, then I'll be quite happy. I wasn't aware that "setfam" was a thing. I'll overhaul one of my "item drop" scripts and see how it works, tonight.
    In KOL: VladYvhuce (#1798867)

  7. #27
    Senior Member VladYvhuce's Avatar
    Join Date
    Feb 2016
    Location
    Kansas
    Posts
    190

    Default

    Nope. That script just makes the familiars cycle and then not use a familiar.

  8. #28
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,224

    Default

    setfam isn't a thing. It's just a boolean variable. Anyway, I think that Theraze meant this. (My addition in red.)

    Code:
    boolean setfam = false;
    foreach f in $familars[astral badger, fist turkey, space jellyfish, restless cow skull, baby sandworm]
    {
       if (!setfam && have_familiar(f) && familiar_weight(f) < 20)
       {
          if (my_familiar() != f)
             use_familiar(f);
          setfam = true;
       }
    }
    if (!setfam && have_familiar($familiar[intergnat] && my_familiar() != $familiar[intergnat])
       use_familiar($familiar[intergnat]);

  9. #29
    Senior Member VladYvhuce's Avatar
    Join Date
    Feb 2016
    Location
    Kansas
    Posts
    190

    Default

    Ok. I'll give that a shot.

  10. #30
    Senior Member Theraze's Avatar
    Join Date
    Mar 2010
    Posts
    8,656

    Default

    Right. I forgot the break; when I did that freehand on the forum, which is how I'd have done it to skip some cycles. Should have done the write-up in npp instead. Oh well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •