Author Topic: Trying my best  (Read 2829 times)

0 Members and 1 Guest are viewing this topic.

Offline M4yH3mTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Activity:
    0%
  • Reputation Power: 1
  • M4yH3m has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Trying my best
« on: April 27, 2020, 12:46:45 AM »
+1
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?
        }



Offline Crisis

  • Global Moderator
  • *
  • *
  • Posts: 3014
  • Activity:
    4.2%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +206
  • Referrals: 2
    • View Profile
Re: Trying my best
« Reply #1 on: April 27, 2020, 02:41:44 AM »
0
I haven't really done much with rails or anything but try this.

Code: [Select]
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?
        }

Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 487
  • Activity:
    0.2%
  • Reputation Power: 10
  • Gaderian barely matters.Gaderian barely matters.
  • Respect: +50
  • Referrals: 3
    • View Profile
Re: Trying my best
« Reply #2 on: April 27, 2020, 11:38:28 AM »
0
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
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline M4yH3mTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Activity:
    0%
  • Reputation Power: 1
  • M4yH3m has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Trying my best
« Reply #3 on: April 27, 2020, 03:15:55 PM »
0
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

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.

Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 487
  • Activity:
    0.2%
  • Reputation Power: 10
  • Gaderian barely matters.Gaderian barely matters.
  • Respect: +50
  • Referrals: 3
    • View Profile
Re: Trying my best
« Reply #4 on: April 27, 2020, 04:30:27 PM »
0
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
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline M4yH3mTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Activity:
    0%
  • Reputation Power: 1
  • M4yH3m has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Trying my best
« Reply #5 on: April 27, 2020, 06:18:37 PM »
0
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

Yes sir, I think I get it. Yes, I am trying to do the solen quests for BOS. I will try to make this work, and get back to you with what I can do.

Tags: