ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Ketchup on May 30, 2015, 09:58:16 PM
-
I'm messing with Gen's - GM Alerter and wondering a few things, I've included the sub that I'm trying to modify and the whole script.
in the sub alert if I remove the gosub pause it does the first thing I want I want it to do, but I'm unsure if this will ruin the rest of the script, I'm removing it because I want it to not pause everytime I move my my character or when a GM moves it. Will doing this also cause it to just keep playing if I have player detection on? if so I don't really mean to do this... the other things I'm thinking of doing is changing the "warning" sound, would I just put another .wav file name in it's place and make sure it's in the same folder as the script? for me the sound is too short,If I miss it the first time, I'll be screwed
also does anyone know the co-ords for the new jail/AFK room? I'm pretty sure that doesn't work either unless it's the warning of being moved setting it off first, so basically I just want it to not pause and for it to keep playing something when I'm moved until I pause and reset the script I guess
sub alert
set *stop #true
if %sound
sound warning.wav
wait 20
gosub s7TTS %1
wait 20
gosub menu_refresh
set %sound #true
if %pause
{
set %jreset #true
set %pause #false
set #menubutton N/A
gosub pause
}
return
;=================================================================
; Script Name: Gen's GM Alert 2.0
; Author: Gen2000
; Version: 2.0
; Shard OSI / FS: OSI
; Release Date: 10/17/09
; Purpose: Menu Driven GM alert and more!
;=================================================================
; Featured Alerts: GM Talks
; Character Moves
; Lost Connection
; Character in Jail
; Character Dead
; Trade Window
;-----------------------------------------------------------------
; Other Features: Voice Alerts! (It talks!)
; Player Detection w/ Name of character detected in menu/voice
;=================================================================
; Requirments: s7TTS VBScript (Included)
; talk VBScript (Included)
; warning.wav (Included)
;=================================================================
; Directions: Make sure all 4 files are in the same folder as euo.
; (Gen's GM Alert 2.0 + 3 files above)
; Start script and check the boxes you want to use.
;=================================================================
; Special Thanks: snicker7/s7Accessability Suite - "Voice Alerts"
;=================================================================
; http://www.scriptuo.com
;=================================================================
gosub setup
;================================================
;----------------Alerts--------------------------
;================================================
; Add/Remove Alerts you want.
; *Make sure %ALERTS = The amount of Alerts.
;================================================
SET %ALERTS 16
set %ALERT1 hail
set %ALERT2 excuse
set %ALERT3 here
set %ALERT4 key
set %ALERT5 greetings
set %ALERT6 are
set %ALERT7 hello
set %ALERT8 csr
set %ALERT9 chat
set %ALERT10 GM
set %ALERT11 Please_enter
set %ALERT12 respond
set %ALERT13 EARep
set %ALERT14 %charname_first
set %ALERT15 %charname_last ;Uses for Lord/Lady.
set %ALERT16 Advisor
;================================================
;----------------Falses--------------------------
;================================================
; If you get a false positive you can add it below.
; Go to Tools/VarDump on EUO
; Scroll down to !Debug.(at the bottom)
; Copy and past that into a new %FALSE
; Update %FALSES at the top.
;================================================
set %FALSES 39
set %FALSE1 you_see:
set %FALSE2 Can't_get_there
set %FALSE3 You_are_now_under_the_protection_of_the_town_guards.
set %FALSE4 Care_to_hear_how_to_earn_some_easy_gold?
set %FALSE5 I_have_an_offer_for_you.
set %FALSE6 You_are_frozen_and_cannot_move.
set %FALSE7 You_are_already_casting_a_spell.
set %FALSE8 You_prepare_to_strike
set %FALSE9 in_Bushido_has
set %FALSE10 This_book_needs_time_to_recharge.
set %FALSE11 You_cannot_cast_that_spell_in_this_form.
set %FALSE12 You_cannot_honor_this_monster_because_it_is_too_damaged.
set %FALSE13 You_have_lost_all_Perfection_in_fighting_this_opponent.
set %FALSE14 Mana_to_use_this_ability.
set %FALSE15 You_cannot_use_this_ability_while_frozen.
set %FALSE16 You_have_lost_some_Perfection_in_fighting_this_opponent.
set %FALSE17 You_did_not_earn_the_right_to_loot_this_creature!
set %FALSE18 You_prepare_to_perform_a_Shadowjump.
set %FALSE19 What_do_you_want_to_use_this_item_on?
set %FALSE20 You_carve_some_meat,_which_remains_on_the_corpse.
set %FALSE21 You_skin_it,_and_the_hides_are_now_in_the_corpse.
set %FALSE22 You_see_nothing_useful_to_carve_from_the_corpse.
set %FALSE23 I_cannot_tell_where_I_am.
set %FALSE24 You_have_Achieved_Perfection_in_inflicting_damage_to_this_opponent!
set %FALSE25 You_have_achieved_the_highest_path_in_Valor_and_can_no_longer_gain_any_further.
set %FALSE26 You_failed_to_create_the_item,_and_some_of_your_materials_are_lost.
set %FALSE27 Tame_which_animal?
set %FALSE28 Click_on_the_person_to_transfer_ownership_to.
set %FALSE29 You_have_earned_250_reward_points_for_this_donation.
set %FALSE30 You_are_overloaded.
set %FALSE31 This_is_currently_in_use.
set %FALSE32 You_are_busy_doing_something_else_and_cannot_focus.
set %FALSE33 You_are_unable_to_resurrect_your_patient.
set %FALSE34 You_are_able_to_resurrect_your_patient.
set %FALSE35 Greetings.__Have_a_look_around.
set %FALSE36 Thank_you_so_much
set %FALSE37 What_shall_I_use_this_key_on?
set %FALSE38 There_is_no_metal_here_to_mine.
set %FALSE39 Where_do_you_wish_to_dig?
;------------------------------------------------
; If an NPC is setting off the player alert.
; Add the NPC name below and update %PDFALSES.
;------------------------------------------------
set %PDFALSES 21
set %PDFALSE1 quest , #spc , giver
set %PDFALSE2 tower , #spc , cryer
set %PDFALSE3 Priest , #spc , Of , #spc , Mondain
set %PDFALSE4 the , #spc , noble
set %PDFALSE5 the , #spc , fighter
set %PDFALSE6 the , #spc , sailor
set %PDFALSE7 the , #spc , thief
set %PDFALSE8 the , #spc , gypsy
set %PDFALSE9 the , #spc , Bard
set %PDFALSE10 the , #spc , artist
set %PDFALSE11 the , #spc , mage
set %PDFALSE12 the , #spc , wandering , #spc , healer
set %PDFALSE13 the , #spc , beggar
set %PDFALSE14 the , #spc , peasant
set %PDFALSE15 the , #spc , sculptor
set %PDFALSE16 The , #spc , Actor
set %PDFALSE17 Refugee
set %PDFALSE18 The , #spc , Hairstylist
set %PDFALSE19 The , #spc , Guard
set %PDFALSE20 Milena
set %PDFALSE21 a , #spc , PK , #spc , dragon
;================================================
;-----------------Main loop----------------------
;================================================
;--------DO NOT EDIT BELOW THIS LINE-------------
;================================================
gosub showEUOMenu1
gosub s7TTS G M Alert is now scanning
loop:
if #MENUBUTTON = CLOSED
halt
if #MENUBUTTON = pause
gosub pause
if %line <= #jindex
{
for %number 1 %alerts
{
scanjournal %line
if %alert . %number in #journal
{
gosub failsafe
if #result
{
if %debug
set !debug_result #journal
gosub updJournalLines #journal
set %alert Talking
set %journal %journalline1
set %pause #true
gosub alert %journalline1
}
}
}
}
menu get playerdetect
if ! #MENURES
goto trade
if %contact_wait < #SCNT
ignoreitem reset name
finditem HS_IS_NAB_OAB_QAB_PAB_MAB_RAB_SAB_LAB_XU_AV_OCB_NCB_CD_ME G_12
if #findkind <> -1
{
if #FINDREP <> 7
{
gosub GetName #findid
if #result
{
set %cname %Propname
set %sound #false
gosub alert %cname , #spc , has , #spc , arrived
set %contact %cname
menu set contact %contact
}
}
ignoreitem #findid name
set %contact_wait #SCNT + 30
}
trade:
menu get tradewindow
if #MENURES
{
if #CONTSIZE = 348_203 && #CONTNAME = trade_gump
{
set %alert Trade Window
set %pause #true
gosub alert Trade , #spc , Winndow
}
}
menu get jail
if #MENURES
{
if #CHARPOSY < 1192 && #CHARPOSY > 1158 && #CHARPOSX < 5312 && #CHARPOSX > 5270
{
set %alert Jail!
set %pause #true
gosub alert You , #spc , are , #spc , in , #spc , jail
}
}
if #CHARNAME = N/A
{
event macro 8 2
wait 10
}
menu get dead
if #MENURES
{
if #CHARGHOST = yes
{
set %alert Your Dead
set %pause #true
gosub alert you , #spc , are , #spc , dead
}
}
menu get lostcon
if #MENURES
{
if #CONTNAME = waiting_gump && #CONTSIZE = 203_121
{
set %alert LostConn
set %pause #true
gosub alert Lost , #spc , Connection
}
}
menu get charmove
if #MENURES
{
if ! %set
gosub setcharpos
if %x <> #CHARPOSX || %y <> #CHARPOSY
{
set %set #false
set %alert Moved
set %pause #true
gosub alert your , #spc , character , #spc , has , #spc , been , #spc , mooved
}
}
if #CLILOGGED <> 1
{
menu set status Halted
menu set Alert Logged
halt
}
goto loop
;================================================
;---------------Subs-----------------------------
;================================================
sub alert
set *stop #true
if %sound
sound warning.wav
wait 20
gosub s7TTS %1
wait 20
gosub menu_refresh
set %sound #true
if %pause
{
set %jreset #true
set %pause #false
set #menubutton N/A
gosub pause
}
return
sub s7TTS
set !_s7TTS_str N/A
for !_s7tts 1 %0
{
if !_s7tts_str <> N/A
set !_s7tts_str !_s7tts_str , #spc , % . !_s7tts
if !_s7tts_str = N/A
set !_s7tts_str % . !_s7tts
}
execute WScript s7TTS.vbs " , !_s7TTS_str , "
return
sub GetName
Event Property %1
if #property = $
return #false
for %number 1 %pdfalses
{
if %pdfalse . %number in #property
return #false
}
str pos #property $
set %strlen #strres - 1
str left #property %strlen
set %PropName #strres
return #true
sub updJournalLines
set %journalLine %1
gosub strreplace journalLine _ #spc
for %journalI 10 2
{
set %_ %journalI - 1
set %journalLine . %journalI %journalLine . %_
}
set %journalline1 %journalLine
return
sub strreplace
str Pos % . %1 %2
if #strRes = 0
return
set %pos #strRes
str del % . %1 %pos 1
str ins #strRes %3 %pos
set % . %1 #strRes
gosub strreplace %1 %2 %3
return
sub failsafe
if %charname_failsafe in #journal
return #false
if #JCOLOR = 53
return #false
if #journal = N/A
return #false
for %number 1 %falses
{
if %false . %number in #journal
return #false
}
if [Alliance] in #journal
return #false
if [Guild] in #journal
return #false
return #true
sub pause
menu set status Paused
menu delete pause
menu Font Color WindowText
menu Font BGColor BtnShadow
menu Button resume 132 88 75 25 Resume
gosub s7TTS G M Alert is now paused
pause:
if #menubutton = closed
halt
if #menubutton = resume
{
if %jreset
set %line #jindex + 1
set %jreset #false
menu set status Scanning...
menu set alert None
menu set journal Waiting...
menu delete resume
menu Font Color WindowText
menu Font BGColor BtnShadow
menu Button pause 132 88 75 25 Pause
gosub s7TTS G M Alert is now scanning
return
}
goto pause
sub menu_refresh
menu set status %status
menu set journal %journal
menu set alert %alert
return
sub setcharpos
set %x #CHARPOSX
set %y #CHARPOSY
set %set #true
return
sub charname
if #CHARNAME = N/A
{
event macro 8 2
wait 10
}
set %charname #CHARNAME
str len %charname
set %len #strres
str pos %charname #spc
set %pos #STRRES
str del %charname %pos %len
set %charname_first #strres
str del %charname 1 %pos
set %charname_last #strres
str len %charname_last
set %len #strres
set %len %len + 1
str ins %charname_last : %len
set %charname_failsafe #strres
if %charname_first = lord || %charname_first = lady
set %charname_first %charname_last
return
;================================================
;---------------Menus----------------------------
;================================================
sub showEUOMenu1
menu Clear
menu Window Title Gen's - GM Alert 2.0 - #charname
menu Window Color Black
menu Window Size 340 225
menu Font Transparent #true
menu Font Align Right
menu Font Name MS Sans Serif
menu Font Size 12
menu Font Style
menu Font Color Aqua
menu Font Transparent #false
menu Font Align Left
menu Font BGColor Black
menu Text EUOLabel1 196 8 Alert:
menu Text EUOLabel2 4 200 Journal:
menu Font Color Lime
menu Text alert 240 8 %alert
menu Text journal 64 200 %journal
menu Font Size 10
menu Font Style bu
menu Font Color Blue
menu Text EUOLabel4 96 52 Choose Alerts Below
menu Font Size 12
menu Font Style
menu Font Color Aqua
menu Text EUOLabel6 4 8 Status:
menu Font Color Lime
menu Text status 60 8 %status
menu Font Color Blue
menu Text EUOLabel3 0 140 ======================================
menu Text EUOLabel5 0 28 ======================================
menu Text EUOLabel7 0 180 ======================================
menu Font Color Aqua
menu Text EUOLabel8 4 160 Last Contact:
menu Font Color Lime
menu Text contact 108 160 %contact
menu Font Size 8
menu Font Color Red
menu Check lostcon 8 116 101 25 #true Lost Connection
menu Check playerdetect 8 76 101 25 #false Player Detection
menu Check tradewindow 228 116 101 25 #true Trade Window
menu Check jail 228 76 101 25 #true Jail
menu Check dead 228 96 101 25 #true Dead
menu Font Color WindowText
menu Font BGColor BtnShadow
menu Button pause 132 88 75 25 Pause
menu Font Color Red
menu Font BGColor Black
menu Check charmove 8 96 101 25 #false Char Moved
menu Show 0 745
return
sub setup
set #lpc 10000
set %line #jindex + 1
ignoreitem #CHARID me
set %status Scanning...
set %alert None
set %journal Waiting...
set %contact None
set %sound #true
set #MENUBUTTON N/A
set %set #false
set %jreset #false
set %pause #false
set %debug #true
gosub charname
return
-
You can change the wave file to any sound you want.
As for the pause, I have no idea. If you step line ( F7) you can see what it would do if you remove it.