Page 1 of 1

Title check.

Posted: Sat Mar 22, 2014 1:51 am
by ZZZZZ
Could anyone with Fire Training and/or Soldier's Attack run this in commandline?

Code: Select all

	totalTitles = RoMScript("GetTitleCount()"); for i=1, totalTitles do; titleName, titleId = RoMScript("GetTitleInfoByIndex("..i..")"); if titleName ~= nil then; if titleName == "Vanguard Field Marshal" then cprintf(cli.yellow,"\nFireTraining - Index: "..i..", ID: "..titleId.."\n") elseif titleName == "Resplendent Carnival Viscount" then cprintf(cli.yellow,"\nSoldier's Attack - Index: "..i..", ID: "..titleId.."\n") end end end
And tell me what the yellow print's are? Thanks :) ~~ It may take a while to run through.

Re: Title check.

Posted: Sat Mar 22, 2014 2:29 am
by rock5
I don't have them but my guess is the title ids are as follows.
  • Vanguard Field Marshal - 530467
    Resplendent Carnival Viscount - 530538
I got the ids using the Rom Language File Converter. http://solarstrike.net/phpBB3/viewtopic ... 258#p22258

If you were after the index numbers, I can't help you there.

Re: Title check.

Posted: Sat Mar 22, 2014 3:09 am
by ZZZZZ
All good. Got a few friends to run it for me, found the index numbers depend on when you got the title....which sucks. I was hoping I would be able to simply check what titles a player had (Fire Training or Soldiers attack) by going through the index number :( Instead just making it use

Code: Select all

RoMScript("SetTitleRequest(530467)"); 
yrest(500); 
if RoMScript("GetCurrentTitle()") == 530467 then
 hasFireTraining = true;
to check...can't think of any other way.

Re: Title check.

Posted: Sat Mar 22, 2014 4:31 am
by rock5
I used some code for getting a title in my ElementConverter script. Let me get it out.

Code: Select all

local HaveFailureTitle = RoMScript("} for i = 0, GetTitleCount() do name, titleID, geted = GetTitleInfoByIndex(i) if titleID == 530897 then a = {geted} end end z= {")
Because it does only one RoMScript, it's very fast.

Re: Title check.

Posted: Sat Mar 22, 2014 5:25 am
by ZZZZZ
Oh, I didn't know you could do RoMScript like that ^.^ Will keep that noted :D

Re: Title check.

Posted: Sat Mar 22, 2014 7:04 am
by ZZZZZ
How do I make this break sequence

Code: Select all

for k,v in pairs(settings.profile.skills) do
			if v.Name=="ALL_FIRE_TRAINING" then		
				RoMScript("SetTitleRequest(530467)");
				cprintf(cli.blue,"\nWill use Fire Training!\n")
				break
			else
				FireTraining = false
			end
		end
I want it to break the loop if firetraining is in profile. Does the 'break' have to be inside the main loop and not the if statement inside loop

Code: Select all

for k,v in pairs(settings.profile.skills) do
break
end
etc for it to work?

Also I know its off-topic but how do you get a macro to work with /wait in it? eg

Code: Select all

RoMScript('CastSpellByName("Shot"); /wait 2;CastSpellByName("Shot"); /wait 2;CastSpellByName("Shot")');
tried with sendMacro as well but just comes up with IGF (ingamefunctions) error.

Re: Title check.

Posted: Sat Mar 22, 2014 10:07 am
by rock5
break breaks from loops only. So the break in the if statement will break out of the for loop.

/wait is not a function, it's a slash command. You can't include that on a line with other code. Can you have a line in a macro with

Code: Select all

/wait 2; CastSpellByName("Shot")
I'm not sure but I don't think so.

I think /wait has to be on it's own line and you can't use RoMScript or sendMacro because they are for normal code that will be preceded with /script.

You have to use SlashCommand. If I remember correctly I added support for multiline slash commands. Here's the comment in the 758 changelog
- Modified the IGF to be able to run multiline slash commands.
  • So now you can effectively run macros from the bot without having to use a SlashCommand per line. Eg.

    Code: Select all

    SlashCommand("/script TargetNearestFriend()/script UseSkill(1,1)/Script ChoiceOption(8)")
Note: if you are using SlashCommand everything has to be a slash command. So normal functions have to be preceeded be /script as per the example above. So something like this should work.

Code: Select all

SlashCommand('/script CastSpellByName("Shot"); /wait 2 /script CastSpellByName("Shot"); /wait 2 /script CastSpellByName("Shot")')
So effectively every slash is treated like a new like in a macro.