how to check whether a given questID exists in a char?

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

ever_boy_
Developers
Developers
Posts: 308
Joined: 06 Jul 2012, 13:44
Noob?: No

how to check whether a given questID exists in a char?

#1 Post by ever_boy_ »

my idea was to iterate through the quest list in an array, and check it by ID, but how do I get the quest list into an array, so that I can use it in a macro?
dracus_loki
Human
Human
Posts: 29
Joined: 13 Jul 2012, 06:32
Noob?: Yes

Re: how to check whether a given questID exists in a char?

#2 Post by dracus_loki »

Im not sure What exactly u need and for what ,, but in most servers the command " @quest " gives the quest ids and all other info
rocknroll
Been there done that!
Been there done that!
Posts: 118
Joined: 19 Sep 2011, 07:30
Noob?: Yes

Re: how to check whether a given questID exists in a char?

#3 Post by rocknroll »

ever_boy_ wrote:my idea was to iterate through the quest list in an array, and check it by ID, but how do I get the quest list into an array, so that I can use it in a macro?
using command quest list in console??
$::questID maybe :lol: try to check it in src :D
Sorry, my english is very bad !
ever_boy_
Developers
Developers
Posts: 308
Joined: 06 Jul 2012, 13:44
Noob?: No

Re: how to check whether a given questID exists in a char?

#4 Post by ever_boy_ »

rocknroll wrote:using command quest list in console??
brilliant. just tell me how can I store the quests's IDs inside an array using quest list command.
nevermind it, I was just being ironic.


let's say I wanted to iterate through chars' ID in my 'ml' list. I would do that:

[codedo eval foreach (@{$::playersList->getItems()}) {next if ( ...[/code]

now I don't know how to do this, looping through the quests' ID, instead of player's ID.
iMikeLance
Moderators
Moderators
Posts: 208
Joined: 01 Feb 2010, 17:37
Noob?: No
Location: Brazil - MG

Re: how to check whether a given questID exists in a char?

#5 Post by iMikeLance »

Do you really want to loop through the list of quests or you just want info about one of them?
ever_boy_
Developers
Developers
Posts: 308
Joined: 06 Jul 2012, 13:44
Noob?: No

Re: how to check whether a given questID exists in a char?

#6 Post by ever_boy_ »

I wanna check whether or not a given quest exists in a char's quest list. How do I do that? By checking a given quest ID (say, 1111) against all ID's in a char's quest list.
The reason for that is that I want to check if the desired quest is active or inactive, but the eval fails when then quest Id doesn't exist.