Anyone Interest in a Language Teacher/Listener Macro?

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

EpicCamp
I like names that start with 'V'
Posts: 45
Joined: Wed Aug 11, 2004 8:39 pm

Anyone Interest in a Language Teacher/Listener Macro?

Post by EpicCamp » Tue Sep 07, 2004 12:16 pm

Seeing the extremely basic language teaching macro in the Macro Depot made me mess with it and want a more automated macro that would automatically cycle through all the languages the "Teacher" knows at the will of the "Listener". As such I made two basic macros so they could talk to each other for when the langs are capped to advance to the next etc. etc.

However they are still basic and not written for use by anyone but myself (character names are hardcoded and more skill cap/error checking should be done)

But I don't want to go messing with that if no one wants this. So just seeing if there's any interest in it before I make a more advanced teaching script. Features would be

--- LangTeach.mac ---
* Automatically cycles through your known languages and teaches them via GroupSay.
* Paramenter given for whom you're teaching it to as to send them a /tell of "info" about the current lang/teacher's current skill/etc. (works in conjunction with the listener macro)

--- LangListen.mac ---
* Parses the /tell given by LangTeach.mac to determine whether or not the listener knows the skill to 100 already (or to the Teacher's ability)
* When capped to 100 (or to Teacher's ability) automatically /tell's the teacher to autoadvance to the next language.

Basically the intent is you start up the listener macro on one person, then start up the teaching macro on the other person. It will automatically cycle through all languages and teach them to the listener so that the listener has the skill levels the teacher does. All unassisted, automatically.

A few posts for interest and i'll finish it up and post.

However one problem (partially why im posting this).

If i switch my current language via "/language <#>" command, any text sent from a macro (or typed in the MQ2 window) is pushed through as Common Tongue.

To Reproduce:
1.) TYPE (no context menus): "/language 2" (doesnt matter what language, just anything but Common Tongue)
2.) Run macro code:

Code: Select all

Sub Main
   /tell Soandso Hello!
/return
OR
inside the MQ2 UI Window, type: "/tell Soandso Hello!"

The text will be Common Tongue regardless. However just typing the same thing in any other window besides MQ2 yields the correct language.

This is avoidable by using Context Menus to select your language, then it all behaves correctly. But using the /language command MQ2 seems to ignore it or something (not quite sure about the workings behind it). As such i've been using a Hotbutton and /keypress to do the text, otherwise the macro would only be sending Common Tongue.

If anyone can give me a solution to this besides using a slow ass Hotbutton, i'll finish the macro as well.

-EpicCamp

Timbuktu
orc pawn
orc pawn
Posts: 24
Joined: Thu May 27, 2004 2:20 pm

Hehe.. not interested any more... I think.

Post by Timbuktu » Tue Oct 12, 2004 4:43 am

I wanted to max out my main's languages and couldn't find any decent trainers that weren't just loops going through the different languages blindly. So I kinda took one of those and reworked it I guess. Added custom events to trigger going to next language... (what a pain.) I'd just like to say now that I'm NO coder. I'm just a tinker who's tryin this out. hehe.. Anyway.. credit or not, I don't care.

Code: Select all

| Lang.mac 
| 
| /macro lang 
| Cycles through all your availible languages 
| Target yourself to end 
| 
| Written by shuttle 
| Converted by bob_the_builder 
| 4_22_04 
|  Updated by loadingpleasewait 9:11:04 
|  Uh.. reworked by Timbuktu?  10/11/04 
|
| Usage:  /mac Lang 
| 
| NOTE: You must have /g spam set to a social on hotbutton 1 to 3 as any other way it does not actually speak the set languages. 
|
| You can also have other skills set on one of the hotbuttons 1 through 3 as long as one is a /g spam hotkey
|

#event LangHelp "Type /language help for a list" 
#event LangUp "#*#tells the group, in #*#'333 #1#'"

Sub Main 

   |SetDeclares 
   /declare LangNum int outer
   /declare MinLangNum int outer 
   /declare MaxLangNum int outer 

   |SetVars 
   /varset LangNum 2
   /varset MinLangNum 2 
   /varset MaxLangNum 25 

   :MainLoop 
	/if (${Target.Name.Equal[${Me.Name}]}) /end 

   |GroupChat 
   /if (${Me.LanguageSkill[${LangNum}]}==100) /goto :Skill
    /notify HotButtonWnd HB_Button1 leftmouseup 
   /delay 1s 
    /notify HotButtonWnd HB_Button2 leftmouseup 
   /delay 1s 
    /notify HotButtonWnd HB_Button3 leftmouseup 
   /delay 1s 
  |IncreaseLanguage 
   /doevents 
   /goto :MainLoop 
:Skill
   /delay 1s
   /varcalc LangNum ${LangNum}+1 
   /if (${LangNum}==26) /end
   /if (${Me.LanguageSkill[${LangNum}]}==100) /goto :Skill
   /lang 1
   /delay 1s
   /gsay 333 ${LangNum}
   /delay 3s
   /lang ${LangNum}
 /goto :MainLoop

Sub event_LangUp(string Line,int NextLang)
    /echo ${NextLang}
   /varset LangNum ${NextLang}
   /lang ${LangNum}
   /return


Sub event_LangHelp 
   /varset LangNum ${MinLangNum} 
/return 

My only real problem is that it doesn't check the language that is currently being used. I couldn't find a.. uh.. whatever them ${} thingies are called... to tell me what the current language was in either string or int form. So, if it gets sidetracked on languages and isn't on the correct one to have people learning/teaching, it won't go anywhere. Oh.. and it will only get one person in the group to 100 before it moves on to the next language.

What I'd like to have it do is to pass data back and forth about the skill level of each language so it can work through each language and verify that every group member's skill is 100 before moving to the next. But I dunno how to do arrays like that, nor like I said can I find a ${} thing to tell me the skill or even name of the current language.

Well, anyway, I'll be done with this macro forever after tonight, so I probably won't read any responses. But good luck with it all, ya'll.

Timbuktu

PS.. I also figured out through doing this that numbers always pass through correctly in any language regardless of skill. That's the reason for the /gsay 333 # stuff.... I think that's how you could pass data about the various language skills back and forth...