Official ScriptUO EasyUO Scripts > Scripting Chat

Trying my best

(1/2) > >>

M4yH3m:
I am writing a script, but have ran into a small snag. I am looking for a particular ID within my script, and I am running a rail looking for the ID. So, my script is basically like this

set %MOB xxxxxx ;this is the creatures ID
set %jStart #jIndex ;start journal scan
wait 10
set %jEnd #jIndex
for %ambitious %jStart %jEnd
{
        scanjournal %MOB
        if (MOB in #journal ) ;when I find the monster
        {
               WHAT DO I DO HERE TO WALK TO THE MONSTER FROM MY RAIL?
        }


Crisis:
I haven't really done much with rails or anything but try this.


--- Code: ---set %MOB xxxxxx ;this is the creatures ID
set %jStart #jIndex ;start journal scan
wait 10
set %jEnd #jIndex
for %ambitious %jStart %jEnd
{
        scanjournal %MOB
        if (MOB in #journal ) ;when I find the monster
        {
          event PathFind #findx #findy #findz ;WHAT DO I DO HERE TO WALK TO THE MONSTER FROM MY RAIL?
        }
--- End code ---

Gaderian:
M4yH3m,
Can you give a description of what you want your script to do?

I don't understand from trying to read that code.

Gaderian

M4yH3m:

--- Quote from: Gaderian on April 27, 2020, 11:38:28 AM ---M4yH3m,
Can you give a description of what you want your script to do?

I don't understand from trying to read that code.

Gaderian

--- End quote ---

The script walks a rail looking for a particular person or monster to accept a quest. I am trying to make the script look for the ID of the MOB while walking the rail, and when it finds the MOB, walk over and single click the mob, and accept the quest.

Gaderian:
So you are setting a for loop variable "%ambitious" and then doing a scanjournal on %MOB.

I suspect you intended to do the scanjournal on %ambitious?

I can't say I understand using the journal messaging in this way.

I would think you would walk to rail and issue a finditem, then go through the list of returned items to search for identifying your NPC of choice.

Once found, approach the NPC to be within the range where it will interact with you for the quest (often 8 to 12 tile distance depending on OSI or freeshard.

So in simple logic / pseudo code:

move to next rail position
check for NPC to give quest
refine the NPC based on Name, ID, or description
if the distance to the NPC is more than the proximity required to interact with the NPC
   move close enough to the NPC
get the quest

Does that seem correct?

This would be structured to repeat the loop and advance the rail point.

Gaderian

Navigation

[0] Message Index

[#] Next page

Go to full version