use magic perfume

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
powerattack
Posts: 37
Joined: Thu Jan 09, 2014 7:44 am

use magic perfume

#1 Post by powerattack »

hey all,

I can't seem to get my magic perfume (30 days) to auto use in my ks script...

Code: Select all

		if not player:hasBuff("Magic Perfume") then
			inventory:useItem(202879);
this is what I get when i try to run it:

Code: Select all

9:47am - scripts\rom/bot.lua:947: Failed to compile and run Lua code for waypoin
t #3
any idea's?
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: use magic perfume

#2 Post by rock5 »

Did you add an "end" for that "if" statement?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
powerattack
Posts: 37
Joined: Thu Jan 09, 2014 7:44 am

Re: use magic perfume

#3 Post by powerattack »

Code: Select all

		ksLog("At waypoint #1: kicking off...", LOGLEVEL_DEBUG);
		changeOptionFriendMob("mob", "IgnoreMePlease", "Add");
		unregisterTimer("KS_Timer");
		
		changeOptionFriendMob("friend", "Crow", "Add");
		changeOptionFriendMob("friend", "Valley Rock Scorpion", "Add");
		registerTimer("KS_Timer", 30000, KSCheckTiming);
		KS_StartTime = os.time();
		player:updateBuffs();
		if not player:hasBuff("May Establish Honor Party") then
			if (inventory:itemTotalCount(202879) > 0) then
				ksLog("Using Teaching scroll", LOGLEVEL_INFO);
				inventory:useItem(202879);
			end;
		end;
		
		KSApplyPots();
		
		sendMacro("/invite "..resetCharacter);
		yrest(3000);
		sendMacro("SetLootMethod(\"freeforall\")")
		KSSetLootValue();

     		if not player:hasBuff("Magic Perfume") then
     		inventory:useItem(202879);

		if (player:hasBuff("Magic Perfume")) then
			ksLog("Magic Perfume detected, disabling looting and bag checks", LOGLEVEL_INFO);
			KS_allow_loot =false; 
			KS_check_bag=true;
			KS_item_queue_size = 20;
		else
			KS_allow_loot =true; 
			KS_check_bag=true;
			KS_item_queue_size = 0;
		end;
this is what I had, now going to try with end; command
User avatar
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: use magic perfume

#4 Post by Ego95 »

Code: Select all

    if not player:hasBuff("Magic Perfume") then
		inventory:useItem(202879);
	end -- this is missing
The "end" is missing like rock said ;)

or you write the whole thing like this:

Code: Select all

    if not player:hasBuff("Magic Perfume") then
		inventory:useItem(202879);
    elseif (player:hasBuff("Magic Perfume")) then
		ksLog("Magic Perfume detected, disabling looting and bag checks", LOGLEVEL_INFO);
		KS_allow_loot =false; 
		KS_check_bag=true;
		KS_item_queue_size = 20;
    else
		KS_allow_loot =true; 
		KS_check_bag=true;
		KS_item_queue_size = 0;
    end;
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: use magic perfume

#5 Post by lisa »

Just thought I would poke my nose in ;)

Code: Select all

    if not player:hasBuff("Magic Perfume") then
      inventory:useItem(202879);
    elseif (player:hasBuff("Magic Perfume")) then
      ksLog("Magic Perfume detected, disabling looting and bag checks", LOGLEVEL_INFO);
      KS_allow_loot =false; 
      KS_check_bag=true;
      KS_item_queue_size = 20;
    else
      KS_allow_loot =true; 
      KS_check_bag=true;
      KS_item_queue_size = 0;
    end;
That code isn't so good, the 3rd part will never ever ever get done because the first 2 parts are true or false for the same thing. So you either have the buff or you don't have the buff and you will never do the 3rd section.

Maybe you could change it so that if you don't have the buff you try to use the item but if the item doesn't exist then change the values.

Code: Select all

    if not player:hasBuff("Magic Perfume") then
		if inventory:getItemCount(202879) ~= 0 then
			inventory:useItem(202879);
		else -- no buff and no item
			KS_allow_loot =true; 
			KS_check_bag=true;
			KS_item_queue_size = 0;	
		end
    else -- has buff
		ksLog("Magic Perfume detected, disabling looting and bag checks", LOGLEVEL_INFO);
		KS_allow_loot =false; 
		KS_check_bag=true;
		KS_item_queue_size = 20;
    end;

As for me I just put this in my profiles onleavecombat section

Code: Select all

	if not player:hasBuff(503479) then -- pet perfume 30 days
		--inventory:useItem(204514) -- 30 day
		inventory:useItem(207582) --1 day
	end	
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
powerattack
Posts: 37
Joined: Thu Jan 09, 2014 7:44 am

Re: use magic perfume

#6 Post by powerattack »

tnx, I will try that in the morning. Its 1:30 am right now so I better fix the script with a clear head.
Post Reply