123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627 |
- # emp_functions
- !! Employmnent and Event Systems
- !! 2023-02-12
- !! Author: Hooded Silence
- !!
- !! v.01 - Initial code base
- !! v.02 - Event generator partially integrated
- !! v.03 - Job management system integrated
- !! v.04 - Start of event generation code integration
- !! v.05 - Date suffix modification
- !! --------------------- UI Interface for Journal
- if $ARGS[0] = 'gen_schedule':
- *clr & cla
- if theme['is_dark'] = 1:
- $header_theme = '#91B0B4'
- $body_theme = '#303030'
- $body_theme_alt = '#474747'
- $font_theme = '#000000'
- else
- $header_theme = '#e27c00'
- $body_theme = '#E0DED4'
- $body_theme_alt = '#D58B32'
- $font_theme = '#FFFFFF'
- end
- if function_sw = 1: '<center><h2>' + $npc_firstname['A<<mod_npc_id>>'] + ' ' + $npc_lastname['A<<mod_npc_id>>'] + '</h2></center>'
- if function_sw = 2:
- gs 'journal', 'journalmenu'
- '<center><h2>Work</h2></center>'
- end
- !! Enable selector if attending school or Uni by NPC group type or by character and set default to School
- if (npc_grupTipe['A<<mod_npc_id>>']>= 1 and npc_grupTipe['A<<mod_npc_id>>']<= 5) or mod_npc_id = 34 and function_sw <= 1:
- if flag_schedule = 0: flag_schedule = 1
- school_group = 1
- '<center>Change to: <a href="exec: flag_schedule = 1 & gs ''emp_functions'', ''gen_schedule''">School</a> | <a href="exec: flag_schedule = 2 & gs ''emp_functions'', ''gen_schedule''">University</a> | <a href="exec: flag_schedule = 3 & gs ''emp_functions'', ''gen_schedule''">Holiday</a> </center>'
- else
- !! Set schedule to holiday / non-edu NPCs
- flag_schedule = 3
- end
- !! Initiate loop variables
- i_day = 1
- mod_max_day = 7
- i_hour = ARGS[1]
- mod_max_hour = ARGS[1] + 8
- header_switch = 1
- killvar '$tablebody'
- killvar '$tableheader'
- !! create header, using header switch to fill in :00 or :30 automatically using mod to determine odd/even and set display hour automatically.
- $tableheader = '<tr border="1" align="center" bgcolor="<<$header_theme>>"><th style="padding: 10px;"></th>'
- :jmp_header_create
- if (i_hour mod 2) = 0:
- display_hour = i_hour/ 2
- end
- if display_hour = 24: Display_hour = 0
- if header_switch = 1:
- header_switch += 1
- $tableheader += '<th style="padding: 10px;"><font color="<<$font_theme>>">' + iif(display_hour < 10, '0<<display_hour >>', display_hour) + ':00</font></th>'
- elseif header_switch=2:
- header_switch = 1
- $tableheader += '<th style="padding: 10px;"><font color="<<$font_theme>>">' + iif(display_hour < 10, '0<<display_hour>>', display_hour) + ':30</font></th>'
- end
- i_hour += 1
- if i_hour <= mod_max_hour: jump 'jmp_header_create'
- ! Reset i_hour for next loop
- killvar 'display_hour'
- i_hour = ARGS[1]
- header_switch = 1
- !! Close out table header
- $tableheader += '</tr>'
- !! Create table body, with alternating colour rows for legibility
- :jmp_day_create
- !Set day
- if i_day = 1 or i_day = 3 or i_day = 5 or i_day = 7:
- $tablebody += '<tr><td style="padding: 10px;" bgcolor="<<$header_theme>>"><b><font color="<<$font_theme>>">' + $week[i_day] + '</font></b></td>'
- else
- $tablebody += '<tr bgcolor="<<$body_theme_alt>>"><td style="padding: 10px;" bgcolor="<<$header_theme>>"><b><font color="<<$font_theme>>">' + $week[i_day] + '</font></b></td>'
- end
- !! fill the slots from the NPC schedule
- :jmp_hour_create
- if i_day >= 1:
- !! Create function switcher:
- !! 1: NPC tracker
- !! 2: Job tracker
- !! 3: Event Tracker
- if function_sw = 1 or function_sw = 0:
- dynamic $schedule_tracker
- elseif function_sw = 2:
- flag_active = 1
- j_id = emp_rota_week['<<i_day>>_<<i_hour>>']
- if emp_rota_week['<<i_day>>_<<i_hour>>'] ! 0:
- $transient_tb = '<a href="exec:gs ''emp_functions'', ''job_info'', <<j_id>>">' + $emp_job_title[j_id] + '</a>'
- else
- $transient_tb = 'Free'
- end
- elseif function_sw = 3:
- else
- msg 'Error - Failed to create body. Please set content switch.'
- end
- if flag_active = 0:
- $tablebody += '<td style="padding: 10px;">Slot: ' + i_hour +'</td>'
- else
- $tablebody += '<td style="padding: 10px;">' + $transient_tb +'</td>'
- flag_active = 0
- end
- killvar '$transient_tb'
- else
- i_day += 1
- jump 'jmp_day_create'
- end
- i_hour += 1
- if i_hour <= mod_max_hour: jump 'jmp_hour_create'
- $tablebody +='</tr>'
- i_day += 1
- i_hour = ARGS[1]
- if i_day <= mod_max_day: jump 'jmp_day_create'
- !! Create navigaton bars
- if (mod_max_hour + 8) <= 48:
- set_hour = ARGS[1] + 8
- $msg_forward = ' | <a href="exec:gs ''emp_functions'', ''gen_schedule'', <<set_hour>>"><b>Forward 4 hours</b></a>'
- else
- $msg_forward = ' | End of Day'
- end
- if hour + 8 < 24 and hour - 8 >= 0:
- set_hour = hour * 2
- $msg_centre = ' | <a href="exec:gs ''emp_functions'', ''gen_schedule'', <<set_hour>>"><b>Jump to current time</b></a>'
- else
- msg_centre = ''
- end
- if (mod_max_hour - 8) > 0:
- set_hour = ARGS[1] - 8
- $msg_back = '<a href="exec:gs ''emp_functions'', ''gen_schedule'', <<set_hour>>"><b>Back 4 hours</b></a>'
- else
- $msg_back = 'Start of day'
- end
- !! Start the table constuction
- '<center><table border=0 cellpadding=1 bgcolor="<<$body_theme>>" width="95%" align="center"><<$tableheader>><<$tablebody>></table>'
- '<<$msg_back>><<$msg_centre>><<$msg_forward>>'
- killvar '$tablebody'
- killvar '$tableheader'
- killvar '$msg_back'
- killvar '$msg_forward'
- *nl
- if function_sw = 1:
- '<b>Note:</b> Times are approximate, some characters will appear at quarter past or quarter to the hour.</center>'
- end
- if function_sw = 2:
- '<b>Note:</b> Times are approximate, some jobs may extend past the allotted time or have flexi-starts.</center>'
- end
- act 'Back':
- killvar 'flag_schedule'
- killvar 'school_group'
- gt $loc, $loc_arg
- end
- end
- !! Job Info popup
- if $ARGS[0] = 'job_info':
- j_id = ARGS[1]
- killvar '$msg_body'
- $msg_body += '<p>Job Title: ' + $emp_job_title[j_id] + '</p>'
- $msg_body += '<p>Location: ' + $emp_job_loc[j_id] + '</p>'
- $msg_body += '<p>Notes: ' + $emp_job_notes[j_id]+ '</p>'
- $msg_body += '<p>Wages: ' + func('agentned', 'format_price_string', emp_job_wages[j_id]) + '<b>₽</b></p>'
- msg $msg_body
- killvar '$msg_body'
- end
- !! Helper QoL function show current job for the journal at right time slot and to deactivate stat_display icon when all jobs are finished
- if $ARGS[0] = 'job_alert':
- !! loop indexes - internal
- !! s_day - track day of week
- s_day = week
- !! s_hour - track hour
- s_hour = 0
- !! jmp_clear = end loop on qualification
- jmp_clear = 0
- !! reset job start and end hour for stat_display
- job_start = 99
- job_end = 99
- !! Check if previous hour was booked - used to determine last working hour for stat_display
- prev_hour = 99
- :s_hour
- if emp_rota_week['<<s_day>>_<<s_hour>>'] = 1:
- prev_hour = s_hour
- if job_start = 99: job_start = s_hour / 2
- elseif emp_rota_week['<<s_day>>_<<s_hour>>'] = 0 and prev_hour ! 99:
- if job_end = 99:
- job_end = prev_hour / 2
- jmp_clear = 1
- end
- end
- s_hour += 1
- if s_hour <= 24 and jmp_clear = 0: jump 's_hour'
- end
- !! --------------------- Event Generator
- !! Author - Hooded Silence
- !! Date created - 26 Aug 22
- !! Event Generator - filler content only for one off events or recurring work from NPCs
- !!
- !! v. 01 - Initial code base
- !! v. 02 - UI improvements and feature feedback
- !! V. 03 - Initial integration into mainline code
- if $ARGS[0] = 'evt_init' :
- !! Placeholder, pending integration
- gt $loc, $loc_arg
- end
- if $ARGS[0] = 'disp_evt':
- if ARGS[1] = 1:
- $evt_suffix = func('shortgs', 'get_number_suffix', transient_evt_day)
- 'I have this job for you do you want to acccept it?'
- *nl
- 'Event Scheduled for: ' + transient_evt_day + $evt_suffix + ', '+ $monthName[transient_evt_month] +' '+ '20' + transient_evt_year
- 'Job: ' + $evt_job[transient_evt_type]
- 'Pay: ' + func('agentned', 'format_price_string', transient_evt_wages)
- 'Time: ' + transient_evt_hour + ':' + iif(transient_evt_minutes >= 0 and transient_evt_minutes <= 4, '00', '30')
- 'Duration: ' + transient_evt_duration + iif(transient_evt_duration = 1, ' hour', ' hours')
- 'Location: ' + $transient_journal
- 'Job Details: ' + $transient_desc
- act 'Accept the job' : gs 'emp_functions', 'cat_evt'
- act 'Decline the job':
- gs 'emp_functions', 'del_evt', 1
- gt 'emp_functions', 'evt_init'
- end
- end
- !! create table for all jobs:
- if ARGS[1] = 2:
- if arrsize('evt_event') > 0:
- killvar '$evtbody'
- job_idx = 0
- *nl
- :jmp_list_create
- if evt_silent[job_idx] = 1:
- $evt_suffix = func('shortgs', 'get_number_suffix', evt_day[job_idx])
- $evtbody += '<tr><td>' +$week[evt_dow[job_idx]]+' '+ evt_day[job_idx] + $evt_suffix + ', '+ $monthName[evt_month[job_idx]] +' 20'+ evt_year[job_idx] + '</td><td>' + $evt_job[evt_event[job_idx]] + '</td>'
- $evtbody += '<td>' + func('agentned', 'format_price_string', evt_wages[job_idx]) + '₽</td><td>' + evt_hour[job_idx] + ':' + iif(evt_minutes[job_idx] >= 0 and evt_minutes[job_idx] <= 4, '00', '30') + '</td>'
- $evtbody += '<td>' + evt_duration[job_idx] + iif(evt_duration[job_idx] = 1, ' hour', ' hours') + '</td><td>' + $evt_journal[job_idx] + '</td>'
- $evtbody += '<td><a href="exec: gs ''emp_functions'',''del_evt'', 2, <<job_idx>>"><img src="images\system\icons\evt_del.png"></a></a></td></tr>'
- end
- job_idx += 1
- if job_idx < arrsize('evt_event') : jump 'jmp_list_create'
- if $evtbody ! '':
- '<center><h2>Current Task List</h2></center>'
- $evtheader = '<tr><th>Date</th><th>Task</th><th>Pay</th><th>Time</th><th>Duration</th><th>Location</th><th>Cancel Job</th></tr>'
- '<center><table width="90%" align="center" width="90%" cellspacing="5" cellpadding="5" valign="top"><tr><<$evtheader>><<$evtbody>></tr></table></center>'
- killvar '$evtbody'
- killvar '$evtheader'
- else
- 'You haven''t taken on any jobs yet.'
- end
- end
- end
- !! Display the location acts
- if ARGS[1] = 3 and evt_chk = 1:
- act_idx = 0
- act_tracker = 0
- act_found = 0
- :jmp_act_create
- if evt_hour[act_tracker] = hour or evt_hour[act_tracker] = (hour -1):
- act_found = 1
- act_idx = act_tracker
- end
- act_tracker +=1
- if act_found = 0:
- if act_tracker < arrsize('evt_event'): jump 'jmp_act_create'
- end
- if ((evt_hour[act_idx] = hour and evt_minutes[act_idx] <= minut) or evt_hour[act_idx] = (hour - 1)) and $loc = $evt_loc[act_idx]:
- act 'Attend your ' + $evt_job[evt_event[act_idx]] + ' event':
- gs 'emp_functions', 'array_init'
- if evt_event = 1:
- gt 'photography_work', 'evt_stage'
- elseif $evt_trigger_exec ! '':
- gt $evt_trigger_exec[act_idx], $evt_trigger[act_idx]
- else
- gt $evt_loc[act_idx], $evt_loc_arg[act_idx]
- end
- killvar 'act_tracker'
- killvar 'act_found'
- end
- end
- end
- end
- if $ARGS[0] = 'gen_evt':
- !! Get the current year - remove 2000 to get the right year for search function.
- transient_evt_year = year - 2000
- !! Figure out the month for the seed and ensure it rolls over into new calendar year.
- if month = 12:
- evt_mseed = 1
- transient_evt_year += 1
- else
- evt_mseed = month + 1
- end
- !! randomise the month and month + 1
- transient_evt_month = rand(month, evt_mseed)
- :jmp_job_create
- if transient_evt_month = month:
- if (day + 7) > monthsend[transient_evt_month]:
- transient_evt_month += 1
- evt_dseed = 1
- end
- else
- evt_dseed = day + 1
- end
- rnd_day = rand(evt_dseed, monthsend[transient_evt_month])
- if transient_evt_month = month and rnd_day <= day: jump 'jmp_job_create'
- !! Set event transients - will be deleted upon completion
- transient_evt_hour = rand(9, 20)
- !! For simplicity sake make minutes on the hour or at half hour intervals, store as a single int.
- transient_evt_minutes = rand(0, 9)
- !! Set as multiples of 60
- if transient_evt_duration <= 0: transient_evt_duration = rand(1,8)
- !! logic check for when randomising event duration
- if transient_evt_duration + transient_evt_hour >= 22:
- transient_evt_hour = 22 - transient_evt_duration
- end
- !! find a suitable date
- srch_day_u = rnd_day + 7
- if srch_day_u >= monthsend[transient_evt_month]:
- srch_day_u = monthsend[transient_evt_month]
- srch_day_l = monthsend[transient_evt_month] - rand(7,14)
- if srch_day_l <= day: srch_day_l = day + 1
- else
- srch_day_l = rnd_day
- end
- :setdayloop
- gs 'shortgs', 'dow', transient_evt_year, transient_evt_month, srch_day_l
- if result = transient_evt_dow:
- transient_evt_day = srch_day_l
- srch_day_l = 99
- else
- srch_day_l += 1
- end
- if srch_day_l <= srch_day_u: jump 'setdayloop'
- end
- ! ------ Helper Functions ------
- if $ARGS[0] = 'job_evt':
- !! Jobs ID list
- $evt_job[1] = 'Photography'
- $evt_job[2] = 'Modelling'
- $evt_job[3] = 'Music Gig'
- $evt_job[4] = 'Dance Show'
- $evt_job[5] = 'Ballet Performance'
- $evt_job[6] = 'Acting'
- $evt_job[50] = 'Sport'
- end
- if $ARGS[0] = 'wage_evt':
- !! calculate wages
- !! Assume you''ll never earn less than 100 roubles
- !! 0 for none, 1 - for a small payment (100-500), 2 - moderate payment (500-1000), 3 - large payment (1000-2000), 4 - huge payment (2000-4000)
- !! 5 is for custom payments
- if ARGS[1] = 0:
- transient_evt_wages = 0
- elseif ARGS[1] = 1:
- transient_evt_wages = func('shortgs','round_tool',rand(100,500), 50)
- elseif ARGS[1] = 2:
- transient_evt_wages = func('shortgs','round_tool',rand(500,1000), 50)
- elseif ARGS[1] = 3:
- transient_evt_wages = func('shortgs','round_tool',rand(1000,2000), 50)
- elseif ARGS[1] = 4:
- transient_evt_wages = func('shortgs','round_tool',rand(2000,4000), 50)
- elseif ARGS[1] = 5:
- transient_evt_wages = ARGS[2]
- end
- end
- if $ARGS[0] = 'cat_evt':
- !! Construct Array Table and clear transients when an event is created and accepted.
- !! Create global variables for the current live event.
- !! Use 0 to create hidden events, 1 to show in journal
- evt_silent[] = transient_evt_silent
- !! Event job descriptor used in Journal
- evt_event[] = transient_evt
- !! Additional job ID if required
- evt_event_sub[] = transient_evt_sub
- !! Day of Week used in Journal and content areas
- evt_dow[] = transient_evt_dow
- !! Event Date to check against current date & used in Journal and content areas
- evt_day[] = transient_evt_day
- !! Event month to check against current month & used in Journal and content areas
- evt_month[] = transient_evt_month
- !! Event Year to check against year & used in Journal and content areas
- evt_year[] = transient_evt_year
- !! Event hour to check against hour & used in Journal and content areas
- evt_hour[] = transient_evt_hour
- !! Event minutes to check against minut & used in Journal and content areas
- evt_minutes[] = transient_evt_minutes
- !! How long the event is to last
- evt_duration[] = transient_evt_duration
- !! How much wages, generated or manual using function
- evt_wages[] = transient_evt_wages
- !! Journal location as reminder
- $evt_journal[] = $transient_journal
- !! The following are event location triggers to allow the content to appear in areas such as community center but host their content elsewhere such as Photography shop
- !! Event area triggers such as city_residential
- $evt_loc[] = $transient_loc
- $evt_loc_arg[] = $transient_arg
- !! Content location - optional
- $evt_trigger_exec = $transient_evt_exec
- $evt_trigger[] = $transient_trigger
- !! Journal and event description
- $evt_desc[] = $transient_desc
- if transient_evt_silent = 1:
- *clr & cla
- 'Job accepted, you currently have ' + arrsize('evt_event') + ' jobs assigned to you. Please look at your journal for more information.'
- gs 'emp_functions', 'del_evt', 1
- act 'Return': gt 'emp_functions', 'evt_init'
- end
- end
- !! delete event after firing or cancelled
- if $ARGS[0] = 'del_evt':
- !! Delete transients
- if ARGS[1] = 1:
- killvar 'transient_evt_silent'
- killvar 'transient_event_type'
- killvar 'transient_evt_year'
- killvar 'transient_evt_month'
- killvar 'transient_evt_hour'
- killvar 'transient_evt_minutes'
- killvar 'transient_evt_duration'
- killvar 'transient_evt_wages'
- killvar '$transient_loc '
- killvar '$transient_arg'
- killvar '$transient_trigger'
- killvar '$transient_img'
- killvar '$transient_desc'
- killvar 'rnd_min'
- killvar 'mseed'
- killvar 'dseed'
- end
- ! Delete array entry
- if ARGS[1] = 2:
- !! delete event after firing or cancelled.
- !! killvar 'arr_name', index
- if ARGS[2] >= 0:
- evt_idx = ARGS[2]
- cla
- 'You''re about to delete this job: '
- 'Delete: ' + evt_event
- 'Index: ' + evt_idx
- Act 'Confirm?':
- cla
- 'Are you sure?'
- act 'Deleting':
- cla
- killvar 'evt_silent', evt_idx
- killvar 'evt_event', evt_idx
- killvar 'evt_dow', evt_idx
- killvar 'evt_day', evt_idx
- killvar 'evt_month', evt_idx
- killvar 'evt_year', evt_idx
- killvar 'evt_hour', evt_idx
- killvar 'evt_minutes', evt_idx
- killvar 'evt_duration', evt_idx
- killvar 'evt_wages', evt_idx
- killvar '$evt_mc_locat', evt_idx
- killvar '$evt_loc', evt_idx
- killvar '$evt_loc_arg', evt_idx
- killvar '$evt_exec', evt_idx
- killvar '$evt_media', evt_idx
- killvar '$evt_desc', evt_idx
- act 'Return': gs 'journal_work', 'start'
- end
- act 'Cancel': gs 'journal_work', 'start'
- end
- else
- '<<evt_idx>> - Invalid record - please check your index'
- end
- end
- end
- if $ARGS[0] = 'evt_day_chk':
- !! Daily event trigger to check if there is an event at currently location to reduce calls/overheads
- evt_chk = 0
- if evt_daily_chk ! daystart:
- evt_daily_chk = daystart
- job_idx = 0
- :evt_day_chk
- if month = evt_month and day = evt_day: evt_chk = 1
- job_idx += 1
- if job_idx < arrsize('evt_event') : jump 'evt_day_chk'
- killvar 'job_idx'
- end
- end
- !! --------------------- End Event Generator
- !! --------------------- Job management system
- !! book role, creates a time slot for emp_rota_week in format day_hour to be used in schedule mode.
- if $ARGS[0] = 'emp_booking':
- gs 'emp_functions', 'emp_chk_clk'
- if emp_rota_fail = 0:
- gs 'emp_functions', 'loop_configure'
- j_finish = emp_job_end[j_id]
- :jmp_daily_book
- j_idx = emp_job_start[j_id]
- :jmp_hour_book
- emp_rota_week['<<d_idx>>_<<j_idx>>'] = j_id
- j_idx += 1
- if j_idx <= j_finish: jump 'jmp_hour_book'
- d_idx += 1
- if d_idx <= d_end: jump 'jmp_daily_book'
- emp_job_status[j_id] = 1
- emp_job[active] += 1
- killvar 'j_idx'
- killvar 'j_finish'
- killvar 'd_idx'
- killvar 'd_end'
- else
- msg 'Sorry, you''ve already got a job for this time period.'
- end
- killvar 'emp_rota_fail'
- end
- !! check if time slots are avaialble for this role.
- if $ARGS[0] = 'emp_chk_clk':
- gs 'emp_functions', 'loop_configure'
- j_finish = emp_job_end[j_id]
- :jmp_daily_chk
- j_idx = emp_job_start[j_id]
- :jmp_job_chk
- if emp_rota_week['<<d_idx>>_<<j_idx>>'] > 0:
- !! booking failed
- emp_rota_fail = 1
- else
- !! booking passed
- emp_rota_fail = 0
- end
- j_idx += 1
- if j_idx <= j_finish and emp_rota_fail = 0: jump 'jmp_job_chk'
- d_idx += 1
- if d_idx <= d_end and emp_rota_fail = 0: jump 'jmp_daily_chk'
- end
- if $ARGS[0] = 'emp_terminate':
- if ARGS[1] >= 4:
- gs 'emp_functions', 'loop_configure'
- j_finish = emp_job_end[j_id]
- :jmp_daily_book
- j_idx = emp_job_start[j_id]
- :jmp_hour_book
- emp_rota_week['<<d_idx>>_<<j_idx>>'] = 0
- j_idx += 1
- if j_idx <= j_finish: jump 'jmp_hour_book'
- d_idx += 1
- if d_idx <= d_end: jump 'jmp_daily_book'
- !! Set the termination value
- emp_job_status[j_id] = ARGS[1]
- emp_job[active] -= 1
- else
- msg 'Job termination failed. Please ensure you set to 4 - Terminated or 5 - Fired'
- end
- killvar 'j_idx'
- killvar 'j_finish'
- killvar 'd_idx'
- killvar 'd_end'
- end
- if $ARGS[0] = 'loop_configure':
- if j_day => 0 and j_day <= 2:
- d_idx = 1
- else
- d_idx = 6
- end
- if j_day <= 1:
- d_end = 5
- else
- d_end = 7
- end
- end
- ! Will need to figure out what we can do to clean this up
- !{
- if $ARGS[0] ! 'loop_configure':
- killvar 'i_day'
- killvar 'i_hour'
- killvar 'j_id'
- killvar 'j_idx'
- killvar 'j_day'
- killvar 'j_finish'
- killvar 'd_idx'
- killvar 'd_end'
- killvar 'evt_idx'
- killvar 'set_hour'
- killvar 'mod_max_day'
- killvar 'mod_max_hour'
- killvar 'header_switch'
- end
- }
- --- emp_functions ---------------------------------
|