dr-scripts icon indicating copy to clipboard operation
dr-scripts copied to clipboard

crossing-training - To teach - annoying screen spam to both teacher and students

Open Windamere opened this issue 6 years ago • 12 comments

Crossing-training.lic - Lines 297-311 on Notepad++, Continues to try teach to " " every 5-10 seconds filling the screen with everyone in the room either trying to teach them over and over even if they are already listening, or telling me they are already being taught by someone else.

Can you please add a catch that stops this if you are already teaching or listening?

Have removed Teach from my yaml as a temporary fix.

Thanks

Windamere avatar Jul 16 '19 18:07 Windamere

https://pastebin.com/jJv4f4WD

Windamere avatar Jul 22 '19 22:07 Windamere

going to bump this. i know exactly what i'd like it to do just not how to code it.. both are creating annoying spam because it continues to check even when already doing.

Crossing-training.lic line 122 check_listening line 123 check_teaching

If already listening || already teaching then stop checking unless line 120 walk_to(@training_room) occurs

Windamere avatar Aug 15 '19 14:08 Windamere

I'm curious about what you're saying about teaching to " ". That definitely shouldn't ever happen -- it means drinfomon thinks that somehow there's a PC named " " in the room, which really seems wrong. That happens to you regularly?

Tarhish avatar Aug 15 '19 19:08 Tarhish

its constant spam, every cycle through main. trying to listen over and over 3 times per cycle(see above pastebin on listen) and trying to teach every single person in the room when i'm already teaching.. Seems like should be a simple "hey if i'm already listening or teaching" then stop checking this iteration of crossing-training. i've taken teach out but can add it to show you a log if needed...it's horrendous lol

i dunno, only dabbling in programming but seems to me like line 122 if != @settings.listening (check_listening) line 123 if != @settings.teaching (check_teaching)

That's probably stupid so forgive my ignorance on coding :)

Windamere avatar Aug 17 '19 15:08 Windamere

I'm curious about what you're saying about teaching to " "

I think that was just a statement about the script attempting to teach to x person, not to the literal " ".

bmcneff avatar Aug 17 '19 15:08 bmcneff

I messed around with this yesterday, finally got it to a point where it quit asking if listening/teaching and spamming the room...but if you quit listening/teaching the event loop doesn't trigger a check.. Think this needs some kind of saved variable for both listening and teaching that the event loop can check if you are already listening or already teaching then don't do the check...if not then do the check_listening and check_teaching.

Windamere avatar Sep 09 '19 16:09 Windamere

Is this getting any traction? Unless we're doing something wrong, teaching/listening in Lich has been pointless to use from my perspective.

GreyhallowDR avatar Oct 14 '19 12:10 GreyhallowDR

I'd like to give this a bump. Teaching needs some attention to become useful unless i'm using it wrong. Lots of spam. Shouldn't offer to teach so frequently after the first time in a given location. Shouldn't offer the same people more than once or twice within a certain amount of time.

GreyhallowDR avatar Dec 20 '19 03:12 GreyhallowDR

@GreyhallowDR Still an issue today?

MahtraDR avatar Jan 24 '23 11:01 MahtraDR

Git blame indicates the teach and listen sections haven't been touched in 6-7 years, so I'm guessing this still happens.

asechrest avatar Jan 24 '23 15:01 asechrest

That being said, after a cursory glance of the code I wonder about the order of these return statements:

  def check_listening
    return unless @settings.listen
    return if listen?(@last_teacher, @settings.listen_observe)
    return if DRRoom.pcs.empty?
    return unless @listen_timer.nil? || Time.now - @listen_timer > 5 * 60
    return unless @class_timer.nil?

    classes = assess_teach
    @last_teacher = classes
                    .reject { |t, s| t.nil? || s.nil? }
                    .sort_by { |_t, s| [DRSkill.getxp(s), DRSkill.getrank(s)] }
                    .find { |t, _s| listen?(t, @settings.listen_observe) }
                    .first

    @listen_timer = @last_teacher ? nil : Time.now
  end

The second return statement calls predicate method DRC.listen? which will brute-force try to listen to the passed-in teacher. Why do we call this method before the following rreturn statements that check if the room is empty, check if our 5 minute listen timer is up, etc.?

Note: I've, literally, never used this script, so I'm just going by what I see in code.

asechrest avatar Jan 24 '23 15:01 asechrest

@GreyhallowDR Can we close this out? Thanks!

MahtraDR avatar Feb 11 '23 23:02 MahtraDR

Closing as very stale. Happy to revisit if it still exists today.

MahtraDR avatar Jul 21 '24 04:07 MahtraDR