#Event PublicNote "[MQ2] setpublicnote #1#"
Sub Main()
/bc Setting text into Guild Management Window, Publc Note
/bc Use /echo setpublicnote YourTextHere
/bc What would you like to insert?
:Primeloop
/doevents
/goto :Primeloop
/return
|==================================================================
| SUB: Event_PublicNote
|==================================================================
Sub Event_PublicNote(Line, publicNote)
/squelch /echo ${Window[GuildManagementWnd].DoOpen}
/delay 3
/notify GuildManagementWnd GT_Subwindows tabselect 2
/delay 3
/notify GuildManagementWnd GT_PublicInput leftmouseup
/delay 3
/call TypeIn "${publicNote}"
/if (${Window[GuildManagementWnd].Child[GT_PublicInput].Text.Length}>0) {
/end
} else {
/bc Nothing was updated, try again or /end macro if you are finished.
}
/return
|==================================================================
| SUB: ClearChat
|==================================================================
Sub ClearChat
/while (${Window[GuildManagementWnd].Child[GT_PublicInput].Text.Length}>0) {
/ctrlkey /shiftkey /keypress home chat
/delay 5
/ctrlkey /shiftkey /keypress delete chat
/delay 5
}
/return
|==================================================================
| SUB: TypeIn
|==================================================================
Sub TypeIn(InStr)
/declare char string local
/declare i int local
/declare index int local
/declare j int local
/for i 1 to ${NetBots.Counts}
/if (${NetBots.Client[${i}].NotEqual[${Me}]}) {
/notify GuildManagementWnd GT_MemberList listselect ${Window[GuildManagementWnd].Child[GT_MemberList].List[=${NetBots.Client[${i}]}]}
/varset index ${Window[GuildManagementWnd].Child[GT_MemberList].List[=${NetBots.Client[${i}]}]}
/bc Setting Guild Management Window index to ${index}
/bc Setting note for ${NetBots.Client[${i}]}
/if (${Window[GuildManagementWnd].Child[GT_MemberList].List[${index}].Equal[${NetBots.Client[${i}]}]}) {
/call ClearChat
/for j 1 to ${InStr.Length}
/varset char ${InStr.Mid[${j},1]}
/if (!${char.Length}) {
/nomodkey /keypress Space chat
} else {
/if (${char.Left[1].Equal[(]}) /return
/if (${char.Left[1].Equal[)]}) /return
/if (${j}==1) {
/shift /keypress ${char} chat
} else {
/nomodkey /keypress ${char} chat
}
}
/next j
}
/notify GuildManagementWnd GT_UpdatePublicButton leftmouseup
}
/delay 2s
/next i
/return