Simple language script

Moderator: MacroQuest Developers

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Simple language script

Post by aChallenged1 » Mon Jul 03, 2006 2:11 pm

I have been wanting to convert a language macro over, and this is what I came up with. It is a bit slower than others, but hey, who cares, it's hands free!

Mind you, it is untested, which is why it is here.

It will only do one language at a time, which is the only draw back.
Later I'll add in another script to run on another group member to stop this, hands free.

Code: Select all

; Langloop.inc
; language trainer for groups 
; original macro developed by BlackTooth 
; If you have two people running this macro 
; You dont need them to be good at all in the language 
; Just set them both on the same language and they 
; Will increase each others skill in the language 
; From 0 to 100 takes a few minutes 
; More peeps you have spamming the faster she goes
; to end have someone in group /gsay "maxed language" or /gsay "done language"


function main()
{
AddTrigger Done "@P1@tells the group@p2@maxed@p3@language@p4@"
AddTrigger Done "@P1@tells the group@p2@done@p3@language@p4@"

   echo Language Macro Starting 
   
   while "${x}"
   { 
      EQExecute /gsay Do you understand me yet? 1
      wait ${Math.Rand[3]:Inc[2]
      EQExecute /gsay Do you understand me yet? 2
      wait ${Math.Rand[3]:Inc[2]
      EQExecute /gsay Do you understand me yet? 3
      wait ${Math.Rand[3]:Inc[2]
      EQExecute /gsay Do you understand me yet? 4
      wait ${Math.Rand[3]:Inc[2]
      EQExecute /gsay Do you understand me yet? 5
      ExecuteQueue
   } 
}

function Done()
{
set:x[FALSE]
Beep
Beep
Beep
}
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

User avatar
MacQ
Macro Author
Macro Author
Posts: 674
Joined: Sat Apr 02, 2005 2:39 pm

Post by MacQ » Fri Jul 28, 2006 4:03 pm

Thanks for this macro aChallenged1. I have my IS subscription and the more examples of IS macros I can find, the more I will learn. I'm still trying to figure out how to even use IS and I know I will eventually get there. Anyway my plan is to eventually convert my macros to IS which I will post to share with the community. Thank God IS has WHILE loops, i hate goto statements.

Yunto?
a grimling bloodguard
a grimling bloodguard
Posts: 502
Joined: Sat Nov 19, 2005 12:05 pm

Re: Simple language script

Post by Yunto? » Fri Jul 28, 2006 5:21 pm

Code: Select all

; Langloop.inc
; language trainer for groups 
; original macro developed by BlackTooth 
; If you have two people running this macro 
; You dont need them to be good at all in the language 
; Just set them both on the same language and they 
; Will increase each others skill in the language 
; From 0 to 100 takes a few minutes 
; More peeps you have spamming the faster she goes
; to end have someone in group /gsay "maxed language" or /gsay "done language"
;Originally by AC1, edited by Yunto?

function main()
{
variable int CurrentLang=1
AddTrigger Done "@P1@tells the group@p2@maxed@p3@language@p4@"
AddTrigger Done "@P1@tells the group@p2@done@p3@language@p4@"

   echo Language Macro Starting 
   EQExecute /lang ${CurrentLang}

   while "${x}"
   { 
      EQExecute /gsay Do you understand me yet? 1
      wait ${Math.Rand[3]:Inc[2]
      EQExecute /gsay Do you understand me yet? 2
      wait ${Math.Rand[3]:Inc[2]
      EQExecute /gsay Do you understand me yet? 3
      wait ${Math.Rand[3]:Inc[2]
      EQExecute /gsay Do you understand me yet? 4
      wait ${Math.Rand[3]:Inc[2]
      EQExecute /gsay Do you understand me yet? 5
      ExecuteQueue
   } 
}

function Done()
{
if (${CurrentLang}>=25) set:x[FALSE]
varcalc CurrentLang ${CurrentLang}+1
Beep
Beep
Beep
}
Is that varcalc how you increment a variable?

Kroak
a grimling bloodguard
a grimling bloodguard
Posts: 1801
Joined: Thu Sep 15, 2005 4:10 am

Post by Kroak » Fri Jul 28, 2006 5:37 pm

I beleive you'd want it this way for the loop... Well, Kinda.

Code: Select all

; Langloop.iss
; language trainer for groups 
; original macro developed by BlackTooth 
; If you have two people running this macro 
; You dont need them to be good at all in the language 
; Just set them both on the same language and they 
; Will increase each others skill in the language 
; From 0 to 100 takes a few minutes 
; More peeps you have spamming the faster she goes 
; to end have someone in group /gsay "maxed language" or /gsay "done language" 

;Modified:  Must set up a hotkey on key 1 with random text of choice.  No /gsay needed.
;Set main window to "Group" channel and "Always chat here" in game.
;Target self to end.


function main() 
{ 
AddTrigger Done "@P1@tells the group@p2@maxed@p3@language@p4@" 
AddTrigger Done "@P1@tells the group@p2@done@p3@language@p4@" 
Declare CurrentLang int 0 
Declare X bool script TRUE
   echo Language Macro Starting 
    
   while "${CurrentLang:Inc}<26"
   { 
   		EQExecute /lang ${CurrentLang}
   		wait 1
      Execute keypress 1
      wait ${Math.Rand[3]:Inc[2]}
      Execute keypress 1 
      wait ${Math.Rand[3]:Inc[2]} 
      Execute keypress 1 
      wait ${Math.Rand[3]:Inc[2]} 
      Execute keypress 1 
      wait ${Math.Rand[3]:Inc[2]} 
      Execute keypress 1 
      ExecuteQueue
      if "${Target.ID}==${Me.ID}"
      	X:Set[FALSE]
      if "!${X}" 
        Call Done
      if "${CurrentLang}==25" 
        CurrentLang:Set[0] 
      if "!${X}"
      	break
   } 
} 

function Done() 
{ 
X:Set[FALSE]
Beep 
Beep 
Beep
}
EDIT: OK, this changes the language on each loop. The /tell to end I haven't tested, but you can target yourself. However, for some reason, the text it sends out to group doesn't change even with only one window, and ISXChatWnd unloaded. /lang does change in main window though.
OK, here's the answer.
Set up a hotkey with text in it, no /gsay.
Set up Main window by clicking "Always chat here" and group as the channel.
Change all lines with

Code: Select all

EQExecute /gsay Do you understand me yet? 1 
to

Code: Select all

Execute keypress 1
Done. Working language trainer that does all languages, should stop on tells and targeting self. Changed code above.
Triggers not working though.

zoobish
a lesser mummy
a lesser mummy
Posts: 40
Joined: Tue Apr 18, 2006 6:59 am

While loops? They just fors and ifs...

Post by zoobish » Tue May 29, 2007 3:18 am

MacQ wrote:Thank God IS has WHILE loops, i hate goto statements.
Like this:

Code: Select all

/for W 1 to 2
    /if (${check}) {
        /echo in while loop...
        ...
        ...
        /varset W 1
    } else {
        /varset W 2
    }
/next W
Is the same as:

Code: Select all

/while (${check}) {
    /echo in while loop...
    ...
    ...
}

xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Simple language script

Post by xyilla » Fri Jul 18, 2025 7:09 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Simple language script

Post by xyilla » Fri Jul 18, 2025 7:10 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Simple language script

Post by xyilla » Fri Jul 18, 2025 7:12 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Simple language script

Post by xyilla » Fri Jul 18, 2025 7:13 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Simple language script

Post by xyilla » Fri Jul 18, 2025 7:14 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Simple language script

Post by xyilla » Fri Jul 18, 2025 7:15 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Simple language script

Post by xyilla » Fri Jul 18, 2025 7:16 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Simple language script

Post by xyilla » Fri Jul 18, 2025 7:17 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Simple language script

Post by xyilla » Fri Jul 18, 2025 7:18 am


xyilla
naggy
naggy
Posts: 33673
Joined: Sun Feb 23, 2025 5:36 am

Re: Simple language script

Post by xyilla » Fri Jul 18, 2025 7:20 am