Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Global Const $bs_groupbox = 7
- Global Const $bs_bottom = 2048
- Global Const $bs_center = 768
- Global Const $bs_defpushbutton = 1
- Global Const $bs_left = 256
- Global Const $bs_multiline = 8192
- Global Const $bs_pushbox = 10
- Global Const $bs_pushlike = 4096
- Global Const $bs_right = 512
- Global Const $bs_rightbutton = 32
- Global Const $bs_top = 1024
- Global Const $bs_vcenter = 3072
- Global Const $bs_flat = 32768
- Global Const $bs_icon = 64
- Global Const $bs_bitmap = 128
- Global Const $bs_notify = 16384
- Global Const $bs_splitbutton = 12
- Global Const $bsitbuttontbutton = 13
- Global Const $bs_commandlink = 14
- Global Const $bsmandlinkandlink = 15
- Global Const $bcsif_glyph = 1
- Global Const $bcsif_image = 2
- Global Const $bcsif_style = 4
- Global Const $bcsif_size = 8
- Global Const $bcss_nosplit = 1
- Global Const $bcss_stretch = 2
- Global Const $bcss_alignleft = 4
- Global Const $bcss_image = 8
- Global Const $button_imageign_lefign_left = 0
- Global Const $button_imagelgn_righgn_right = 1
- Global Const $button_imaglign_tolign_top = 2
- Global Const $button_imagelin_botton_bottom = 3
- Global Const $button_imagelin_centen_center = 4
- Global Const $bs_3state = 5
- Global Const $bs_auto3state = 6
- Global Const $bs_autocheckbox = 3
- Global Const $bs_checkbox = 2
- Global Const $bs_radiobutton = 4
- Global Const $bs_iobuttonobutton = 9
- Global Const $bs_ownerdraw = 11
- Global Const $gui_sst_button_button = 0
- Global Const $gui_ss_dcheckboxheckbox = 0
- Global Const $gui_slt_groupt_group = 0
- Global Const $gui_slt_radiot_radio = 0
- Global Const $bcm_first = 5632
- Global Const $bcm_getidealsize = ($bcm_first + 1)
- Global Const $bcm_getimagelist = ($bcm_first + 3)
- Global Const $bcm_getnote = ($bcm_first + 10)
- Global Const $bctelengthelength = ($bcm_first + 11)
- Global Const $bcm_getsplitinfo = ($bcm_first + 8)
- Global Const $bcxtmargintmargin = ($bcm_first + 5)
- Global Const $bcm_sownstatewnstate = ($bcm_first + 6)
- Global Const $bcm_setimagelist = ($bcm_first + 2)
- Global Const $bcm_setnote = ($bcm_first + 9)
- Global Const $bcm_setshield = ($bcm_first + 12)
- Global Const $bcm_setsplitinfo = ($bcm_first + 7)
- Global Const $bcxtmargintmargin = ($bcm_first + 4)
- Global Const $bm_click = 245
- Global Const $bm_getcheck = 240
- Global Const $bm_getimage = 246
- Global Const $bm_getstate = 242
- Global Const $bm_setcheck = 241
- Global Const $bm_setdontclick = 248
- Global Const $bm_setimage = 247
- Global Const $bm_setstate = 243
- Global Const $bm_setstyle = 244
- Global Const $bcn_first = -1250
- Global Const $bcn_dropdown = ($bcn_first + 2)
- Global Const $bcemchangemchange = ($bcn_first + 1)
- Global Const $bn_clicked = 0
- Global Const $bn_paint = 1
- Global Const $bn_hilite = 2
- Global Const $bn_unhilite = 3
- Global Const $bn_disable = 4
- Global Const $bn_doubleclicked = 5
- Global Const $bn_setfocus = 6
- Global Const $bn_killfocus = 7
- Global Const $bn_pushed = $bn_hilite
- Global Const $bn_unpushed = $bn_unhilite
- Global Const $bn_dblclk = $bn_doubleclicked
- Global Const $bst_checked = 1
- Global Const $bserminaterminate = 2
- Global Const $bst_unchecked = 0
- Global Const $bst_focus = 8
- Global Const $bst_pushed = 4
- Global Const $bst_dontclick = 128
- Global Const $cb_err = -1
- Global Const $cb_errattribute = -3
- Global Const $cb_errrequired = -4
- Global Const $cb_errspace = -2
- Global Const $cb_okay = 0
- Global Const $state_snvisiblevisible = 32768
- Global Const $state_pressedpressed = 8
- Global Const $cbs_autohscroll = 64
- Global Const $cbs_noscrolloscroll = 2048
- Global Const $cbs_dropdown = 2
- Global Const $cbs_dropdownlist = 3
- Global Const $cbs_hasstrings = 512
- Global Const $cbs_lowercase = 16384
- Global Const $cbs_nalheightlheight = 1024
- Global Const $cbs_oemconvert = 128
- Global Const $cbsrawfixedawfixed = 16
- Global Const $cbs_owvariableariable = 32
- Global Const $cbs_simple = 1
- Global Const $cbs_sort = 256
- Global Const $cbs_uppercase = 8192
- Global Const $cbm_first = 5888
- Global Const $cb_addstring = 323
- Global Const $cb_deletestring = 324
- Global Const $cb_dir = 325
- Global Const $cb_findstring = 332
- Global Const $cb_ingexactngexact = 344
- Global Const $cb_oboxinfoboxinfo = 356
- Global Const $cb_getcount = 326
- Global Const $cb_getcuebanner = ($cbm_first + 4)
- Global Const $cb_getcursel = 327
- Global Const $cb_getdrotrolrectrolrect = 338
- Global Const $cb_pedstateedstate = 343
- Global Const $cb_pedwidthedwidth = 351
- Global Const $cb_geteditsel = 320
- Global Const $cb_getextendedui = 342
- Global Const $cb_gethalextentlextent = 349
- Global Const $cb_getitemdata = 336
- Global Const $cb_getitemheight = 340
- Global Const $cb_getlbtext = 328
- Global Const $cb_getlbtextlen = 329
- Global Const $cb_getlocale = 346
- Global Const $cb_getminvisible = 5890
- Global Const $cb_gettopindex = 347
- Global Const $cb_initstorage = 353
- Global Const $cb_limittext = 321
- Global Const $cb_resetcontent = 331
- Global Const $cb_insertstring = 330
- Global Const $cb_selectstring = 333
- Global Const $cb_setcuebanner = ($cbm_first + 3)
- Global Const $cb_setcursel = 334
- Global Const $cb_pedwidthedwidth = 352
- Global Const $cb_seteditsel = 322
- Global Const $cb_setextendedui = 341
- Global Const $cb_sethalextentlextent = 350
- Global Const $cb_setitemdata = 337
- Global Const $cb_setitemheight = 339
- Global Const $cb_setlocale = 345
- Global Const $cb_setminvisible = 5889
- Global Const $cb_settopindex = 348
- Global Const $cb_showdropdown = 335
- Global Const $cbn_closeup = 8
- Global Const $cbn_dblclk = 2
- Global Const $cbn_dropdown = 7
- Global Const $cbn_editchange = 5
- Global Const $cbn_editupdate = 6
- Global Const $cbn_errspace = (-1)
- Global Const $cbn_killfocus = 4
- Global Const $cbn_selchange = 1
- Global Const $cbn_selendcancel = 10
- Global Const $cbn_selendok = 9
- Global Const $cbn_setfocus = 3
- Global Const $cbes_eensitivensitive = 16
- Global Const $cbesditimageitimage = 1
- Global Const $cbes_ex_nogeindengeindent = 2
- Global Const $cbesizelimitzelimit = 8
- Global Const $__comboboxc_wm_use_wm_user = 1024
- Global Const $cbem_deleteitem = $cb_deletestring
- Global Const $cbem_ocontrolcontrol = ($__comboboxc_wm_use_wm_user + 6)
- Global Const $cbemtcontrolcontrol = ($__comboboxc_wm_use_wm_user + 7)
- Global Const $cbem_getexstyle = ($__comboboxc_wm_use_wm_user + 9)
- Global Const $cbem_gdedstyleedstyle = ($__comboboxc_wm_use_wm_user + 9)
- Global Const $cbmagelistagelist = ($__comboboxc_wm_use_wm_user + 3)
- Global Const $cbem_getitema = ($__comboboxc_wm_use_wm_user + 4)
- Global Const $cbem_getitemw = ($__comboboxc_wm_use_wm_user + 13)
- Global Const $cbem_gdeformateformat = 8192 + 6
- Global Const $cbemtchangedchanged = ($__comboboxc_wm_use_wm_user + 10)
- Global Const $cbem_insertitema = ($__comboboxc_wm_use_wm_user + 1)
- Global Const $cbem_insertitemw = ($__comboboxc_wm_use_wm_user + 11)
- Global Const $cbem_setexstyle = ($__comboboxc_wm_use_wm_user + 8)
- Global Const $cbem_sdedstyleedstyle = ($__comboboxc_wm_use_wm_user + 14)
- Global Const $cbmagelistagelist = ($__comboboxc_wm_use_wm_user + 2)
- Global Const $cbem_setitema = ($__comboboxc_wm_use_wm_user + 5)
- Global Const $cbem_setitemw = ($__comboboxc_wm_use_wm_user + 12)
- Global Const $cbem_sdeformateformat = 8192 + 5
- Global Const $cbemdowthemeowtheme = 8192 + 11
- Global Const $cben_first = (-800)
- Global Const $cben_last = (-830)
- Global Const $cben_beginedit = ($cben_first - 4)
- Global Const $cben_deleteitem = ($cben_first - 2)
- Global Const $cben_dragbegina = ($cben_first - 8)
- Global Const $cben_dragbeginw = ($cben_first - 9)
- Global Const $cben_endedita = ($cben_first - 5)
- Global Const $cben_endeditw = ($cben_first - 6)
- Global Const $cben_getdispinfo = ($cben_first + 0)
- Global Const $cbispinfoaspinfoa = ($cben_first + 0)
- Global Const $cbispinfowspinfow = ($cben_first - 7)
- Global Const $cben_insertitem = ($cben_first - 1)
- Global Const $cbeif_di_setitem = 268435456
- Global Const $cbeif_image = 2
- Global Const $cbeif_indent = 16
- Global Const $cbeif_lparam = 32
- Global Const $cbeif_overlay = 8
- Global Const $cbeitedimageedimage = 4
- Global Const $cbeif_text = 1
- Global Const $gui_slt_combot_combo = 2097218
- Global Const $es_left = 0
- Global Const $es_center = 1
- Global Const $es_right = 2
- Global Const $es_multiline = 4
- Global Const $es_uppercase = 8
- Global Const $es_lowercase = 16
- Global Const $es_password = 32
- Global Const $es_autovscroll = 64
- Global Const $es_autohscroll = 128
- Global Const $es_nohidesel = 256
- Global Const $es_oemconvert = 1024
- Global Const $es_readonly = 2048
- Global Const $es_wantreturn = 4096
- Global Const $es_number = 8192
- Global Const $ec_err = -1
- Global Const $ecm_first = 5376
- Global Const $em_canundo = 198
- Global Const $em_charfrompos = 215
- Global Const $em_dobufferobuffer = 205
- Global Const $em_fmtlines = 200
- Global Const $em_getcuebanner = ($ecm_first + 2)
- Global Const $em_getfiblelinebleline = 206
- Global Const $em_gethandle = 189
- Global Const $em_getimestatus = 217
- Global Const $em_getlimittext = 213
- Global Const $em_getline = 196
- Global Const $em_getlinecount = 186
- Global Const $em_getmargins = 212
- Global Const $em_getmodify = 184
- Global Const $em_wordcharordchar = 210
- Global Const $em_getrect = 178
- Global Const $em_getsel = 176
- Global Const $em_getthumb = 190
- Global Const $em_greakproceakproc = 209
- Global Const $emlloontiploontip = ($ecm_first + 4)
- Global Const $em_limittext = 197
- Global Const $em_linefromchar = 201
- Global Const $em_lineindex = 187
- Global Const $em_linelength = 193
- Global Const $em_linescroll = 182
- Global Const $em_posfromchar = 214
- Global Const $em_replacesel = 194
- Global Const $em_scroll = 181
- Global Const $em_scrollcaret = 183
- Global Const $em_setcuebanner = ($ecm_first + 1)
- Global Const $em_sethandle = 188
- Global Const $em_setimestatus = 216
- Global Const $em_setlimittext = $em_limittext
- Global Const $em_setmargins = 211
- Global Const $em_setmodify = 185
- Global Const $em_wordcharordchar = 204
- Global Const $em_setreadonly = 207
- Global Const $em_setrect = 179
- Global Const $em_setrectnp = 180
- Global Const $em_setsel = 177
- Global Const $em_settabstops = 203
- Global Const $em_sreakproceakproc = 208
- Global Const $emlloontiploontip = ($ecm_first + 3)
- Global Const $em_undo = 199
- Global Const $ec_leftmargin = 1
- Global Const $ec_rightmargin = 2
- Global Const $ec_usefontinfo = 65535
- Global Const $emsis_coonstringnstring = 1
- Global Const $eimes_gtratonceratonce = 1
- Global Const $eimes_cancerinfocurinfocus = 2
- Global Const $eimes_completecillfocuillfocus = 4
- Global Const $en_align_ltr_ec = 1792
- Global Const $en_align_rtl_ec = 1793
- Global Const $en_change = 768
- Global Const $en_errspace = 1280
- Global Const $en_hscroll = 1537
- Global Const $en_killfocus = 512
- Global Const $en_maxtext = 1281
- Global Const $en_setfocus = 256
- Global Const $en_update = 1024
- Global Const $en_vscroll = 1538
- Global Const $gui_ult_editlt_edit = 3150016
- Global Const $gui_slt_inputt_input = 128
- Global Const $gui_event_close = -3
- Global Const $guiminimizeinimize = -4
- Global Const $gu_restorerestore = -5
- Global Const $guimaximizeaximize = -6
- Global Const $gui_evmarydownarydown = -7
- Global Const $gui_rimaryupimaryup = -8
- Global Const $gui_evendarydownarydown = -9
- Global Const $gui_evondaryupndaryup = -10
- Global Const $gui_ousemoveusemove = -11
- Global Const $gu_resizedresized = -12
- Global Const $gu_droppeddropped = -13
- Global Const $gui_rundefmsg = "GUI_RUNDEFMSG"
- Global Const $gui_avistop = 0
- Global Const $gui_avistart = 1
- Global Const $gui_aviclose = 2
- Global Const $gui_checked = 1
- Global Const $guerminaterminate = 2
- Global Const $gui_unchecked = 4
- Global Const $gui_dropaccepted = 8
- Global Const $guiacceptedccepted = 4096
- Global Const $gui_acceptfiles = $gui_dropaccepted
- Global Const $gui_show = 16
- Global Const $gui_hide = 32
- Global Const $gui_enable = 64
- Global Const $gui_disable = 128
- Global Const $gui_focus = 256
- Global Const $gui_nofocus = 8192
- Global Const $gui_defbutton = 512
- Global Const $gui_expand = 1024
- Global Const $gui_ontop = 2048
- Global Const $gui_fontitalic = 2
- Global Const $gui_fontunder = 4
- Global Const $gui_fontstrike = 8
- Global Const $gui_dockauto = 1
- Global Const $gui_dockleft = 2
- Global Const $gui_dockright = 4
- Global Const $gui_dockhcenter = 8
- Global Const $gui_docktop = 32
- Global Const $gui_dockbottom = 64
- Global Const $gui_dockvcenter = 128
- Global Const $gui_dockwidth = 256
- Global Const $gui_dockheight = 512
- Global Const $gui_docksize = 768
- Global Const $gui_dockmenubar = 544
- Global Const $gui_dockstatebar = 576
- Global Const $gui_dockall = 802
- Global Const $gui_dockborders = 102
- Global Const $gui_gr_close = 1
- Global Const $gui_gr_line = 2
- Global Const $gui_gr_bezier = 4
- Global Const $gui_gr_move = 6
- Global Const $gui_gr_color = 8
- Global Const $gui_gr_rect = 10
- Global Const $gui_gr_ellipse = 12
- Global Const $gui_gr_pie = 14
- Global Const $gui_gr_dot = 16
- Global Const $gui_gr_pixel = 18
- Global Const $gui_gr_hint = 20
- Global Const $gui_gr_refresh = 22
- Global Const $gui_gr_pensize = 24
- Global Const $gui_gr_nobkcolor = -2
- Global Const $gui__defaultdefault = -1
- Global Const $gui_bkconsparentsparent = -2
- Global Const $gui_bkcollternatlternate = -33554432
- Global Const $gui_wrentdragentdrag = 1048576
- Global Const $ss_left = 0
- Global Const $ss_center = 1
- Global Const $ss_right = 2
- Global Const $ss_icon = 3
- Global Const $ss_blackrect = 4
- Global Const $ss_grayrect = 5
- Global Const $ss_whiterect = 6
- Global Const $ss_blackframe = 7
- Global Const $ss_grayframe = 8
- Global Const $ss_whiteframe = 9
- Global Const $ss_simple = 11
- Global Const $sswordwrapordwrap = 12
- Global Const $ss_bitmap = 14
- Global Const $ss_etchedhorz = 16
- Global Const $ss_etchedvert = 17
- Global Const $ss_etchedframe = 18
- Global Const $ss_noprefix = 128
- Global Const $ss_notify = 256
- Global Const $ss_centerimage = 512
- Global Const $ss_rightjust = 1024
- Global Const $ss_sunken = 4096
- Global Const $gui_slt_labelt_label = 0
- Global Const $gui_ss__graphicgraphic = 0
- Global Const $gui_ult_iconlt_icon = $ss_notify
- Global Const $guiault_picult_pic = $ss_notify
- Global Const $wc_animate = "SysAnimate32"
- Global Const $wc_button = "Button"
- Global Const $wc_combobox = "ComboBox"
- Global Const $wc_comboboxex = "ComboBoxEx32"
- Global Const $wc_datetimepick = "SymePick32ePick32"
- Global Const $wc_edit = "Edit"
- Global Const $wc_header = "SysHeader32"
- Global Const $wc_hotkey = "msctls_hotkey32"
- Global Const $wc_ipaddress = "SysIPAddress32"
- Global Const $wc_link = "SysLink"
- Global Const $wc_listbox = "ListBox"
- Global Const $wc_listview = "SysListView32"
- Global Const $wc_monthcal = "SysMonthCal32"
- Global Const $wc_nativefontctl = "NativeFontCtl"
- Global Const $wc_pagescroller = "SysPager"
- Global Const $wc_progress = "msogress32gress32"
- Global Const $wc_rebar = "ReBarWindow32"
- Global Const $wc_scrollbar = "ScrollBar"
- Global Const $wc_static = "Static"
- Global Const $wc_statusbar = "msctusbar32usbar32"
- Global Const $wc_tabcontrol = "SysTabControl32"
- Global Const $wc_toolbar = "ToolbarWindow32"
- Global Const $wc_tooltips = "tooltips_class32"
- Global Const $wc_trackbar = "msackbar32ckbar32"
- Global Const $wc_treeview = "SysTreeView32"
- Global Const $wc_updown = "msctls_updown32"
- Global Const $ws_overlapped = 0
- Global Const $ws_tiled = $ws_overlapped
- Global Const $ws_maximizebox = 65536
- Global Const $ws_minimizebox = 131072
- Global Const $ws_tabstop = 65536
- Global Const $ws_group = 131072
- Global Const $ws_sizebox = 262144
- Global Const $ws_thickframe = $ws_sizebox
- Global Const $ws_sysmenu = 524288
- Global Const $ws_hscroll = 1048576
- Global Const $ws_vscroll = 2097152
- Global Const $ws_dlgframe = 4194304
- Global Const $ws_border = 8388608
- Global Const $ws_caption = 12582912
- Global Const $ws_oedwindowdwindow = BitOR($ws_caption, $ws_maximizebox, $ws_minimizebox, $ws_overlapped, $ws_sysmenu, $ws_thickframe)
- Global Const $ws_tiledwindow = $ws_oedwindowdwindow
- Global Const $ws_maximize = 16777216
- Global Const $ws_clipchildren = 33554432
- Global Const $ws_clipsiblings = 67108864
- Global Const $ws_disabled = 134217728
- Global Const $ws_visible = 268435456
- Global Const $ws_minimize = 536870912
- Global Const $ws_iconic = $ws_minimize
- Global Const $ws_child = 1073741824
- Global Const $ws_childwindow = $ws_child
- Global Const $ws_popup = -2147483648
- Global Const $ws_popupwindow = -2138570752
- Global Const $ds_3dlook = 4
- Global Const $ds_absalign = 1
- Global Const $ds_center = 2048
- Global Const $ds_centermouse = 4096
- Global Const $ds_contexthelp = 8192
- Global Const $ds_control = 1024
- Global Const $ds_fixedsys = 8
- Global Const $ds_localedit = 32
- Global Const $ds_modalframe = 128
- Global Const $ds_nofailcreate = 16
- Global Const $ds_noidlemsg = 256
- Global Const $ds_setfont = 64
- Global Const $ds_setforeground = 512
- Global Const $ds_shellfont = BitOR($ds_fixedsys, $ds_setfont)
- Global Const $ds_sysmodal = 2
- Global Const $wseptfilesptfiles = 16
- Global Const $ws_ex_appwindow = 262144
- Global Const $ws_ex_composited = 33554432
- Global Const $ws_eolparentlparent = 65536
- Global Const $ws_ex_clientedge = 512
- Global Const $wstexthelpexthelp = 1024
- Global Const $ws_edalframealframe = 1
- Global Const $ws_ex_layered = 524288
- Global Const $ws_ex_layoutrtl = 4194304
- Global Const $ws_ex_left = 0
- Global Const $ws_ecrollbarrollbar = 16384
- Global Const $ws_ex_ltrreading = 0
- Global Const $ws_ex_mdichild = 64
- Global Const $ws_ex_noactivate = 134217728
- Global Const $ws_ex_itlayouttlayout = 1048576
- Global Const $ws_exntnotifytnotify = 4
- Global Const $ws_ex_right = 4096
- Global Const $ws_excrollbarrollbar = 0
- Global Const $ws_ex_rtlreading = 8192
- Global Const $ws_ex_staticedge = 131072
- Global Const $ws_ex_toolwindow = 128
- Global Const $ws_ex_topmost = 8
- Global Const $wsnsparentsparent = 32
- Global Const $ws_ex_windowedge = 256
- Global Const $ws_ex_oedwindowdwindow = BitOR($ws_ex_clientedge, $ws_ex_windowedge)
- Global Const $ws_etewindowewindow = BitOR($ws_ex_toolwindow, $ws_ex_topmost, $ws_ex_windowedge)
- Global Const $wm_null = 0
- Global Const $wm_create = 1
- Global Const $wm_destroy = 2
- Global Const $wm_move = 3
- Global Const $wm_sizewait = 4
- Global Const $wm_size = 5
- Global Const $wm_activate = 6
- Global Const $wm_setfocus = 7
- Global Const $wm_killfocus = 8
- Global Const $wm_setvisible = 9
- Global Const $wm_enable = 10
- Global Const $wm_setredraw = 11
- Global Const $wm_settext = 12
- Global Const $wm_gettext = 13
- Global Const $wm_gettextlength = 14
- Global Const $wm_paint = 15
- Global Const $wm_close = 16
- Global Const $wm_dsessionsession = 17
- Global Const $wm_quit = 18
- Global Const $wm_erasebkgnd = 20
- Global Const $wm_queryopen = 19
- Global Const $wmorchangerchange = 21
- Global Const $wm_endsession = 22
- Global Const $wm_systemerror = 23
- Global Const $wm_showwindow = 24
- Global Const $wm_ctlcolor = 25
- Global Const $wm_settingchange = 26
- Global Const $wm_wininichange = 26
- Global Const $wm_devmodechange = 27
- Global Const $wm_activateapp = 28
- Global Const $wm_fontchange = 29
- Global Const $wm_timechange = 30
- Global Const $wm_cancelmode = 31
- Global Const $wm_setcursor = 32
- Global Const $wm_mouseactivate = 33
- Global Const $wm_childactivate = 34
- Global Const $wm_queuesync = 35
- Global Const $wm_getminmaxinfo = 36
- Global Const $wm_logoff = 37
- Global Const $wm_painticon = 38
- Global Const $wmasebkgndsebkgnd = 39
- Global Const $wm_nextdlgctl = 40
- Global Const $wm_alttabactive = 41
- Global Const $wm_spoolerstatus = 42
- Global Const $wm_drawitem = 43
- Global Const $wm_measureitem = 44
- Global Const $wm_deleteitem = 45
- Global Const $wm_vkeytoitem = 46
- Global Const $wm_chartoitem = 47
- Global Const $wm_setfont = 48
- Global Const $wm_getfont = 49
- Global Const $wm_sethotkey = 50
- Global Const $wm_gethotkey = 51
- Global Const $wm_filesyschange = 52
- Global Const $wm_isactiveicon = 53
- Global Const $wm_queryparkicon = 54
- Global Const $wm_querydragicon = 55
- Global Const $wm_winhelp = 56
- Global Const $wm_compareitem = 57
- Global Const $wm_fullscreen = 58
- Global Const $wmshutdownhutdown = 59
- Global Const $wm_ddemlevent = 60
- Global Const $wm_getobject = 61
- Global Const $wm_calcscroll = 63
- Global Const $wm_testing = 64
- Global Const $wm_compacting = 65
- Global Const $wm_othwcreatedcreated = 66
- Global Const $wm_otherestroyedstroyed = 67
- Global Const $wm_commnotify = 68
- Global Const $wm_meuschangeschange = 69
- Global Const $wm_wichanginghanging = 70
- Global Const $wm_wschangedchanged = 71
- Global Const $wm_power = 72
- Global Const $wmobaldatabaldata = 73
- Global Const $wm_copydata = 74
- Global Const $wm_canceljournal = 75
- Global Const $wm_logonnotify = 76
- Global Const $wm_keyf1 = 77
- Global Const $wm_notify = 78
- Global Const $wm_access_window = 79
- Global Const $wm_inputlaerequeserequest = 80
- Global Const $wm_ngchangegchange = 81
- Global Const $wm_tcard = 82
- Global Const $wm_help = 83
- Global Const $wm_userchanged = 84
- Global Const $wm_notifyformat = 85
- Global Const $wm_qm_activate = 96
- Global Const $wm_hcallbackallback = 97
- Global Const $wm_syscopydata = 98
- Global Const $wm_finaldestroy = 112
- Global Const $wm_measureientdatientdata = 113
- Global Const $wm_contextmenu = 123
- Global Const $wm_stylechanging = 124
- Global Const $wm_stylechanged = 125
- Global Const $wm_displaychange = 126
- Global Const $wm_geticon = 127
- Global Const $wm_seticon = 128
- Global Const $wm_nccreate = 129
- Global Const $wm_ncdestroy = 130
- Global Const $wm_nccalcsize = 131
- Global Const $wm_nchittest = 132
- Global Const $wm_ncpaint = 133
- Global Const $wm_ncactivate = 134
- Global Const $wm_getdlgcode = 135
- Global Const $wm_syncpaint = 136
- Global Const $wm_synctask = 137
- Global Const $wm_kludgeminrect = 139
- Global Const $wm_lwitchwnditchwnd = 140
- Global Const $wm_uoywindowywindow = 144
- Global Const $wm_uahdrawmenu = 145
- Global Const $wm_menuitemenuitem = 146
- Global Const $wm_uahinitmenu = 147
- Global Const $wm_uahmenuitemenuitem = 148
- Global Const $wm_uahnenupopupnupopup = 149
- Global Const $wm_ncmousemove = 160
- Global Const $wm_nclbuttondown = 161
- Global Const $wm_nclbuttonup = 162
- Global Const $wm_ondblclkndblclk = 163
- Global Const $wm_ncrbuttondown = 164
- Global Const $wm_ncrbuttonup = 165
- Global Const $wm_ondblclkndblclk = 166
- Global Const $wm_ncmbuttondown = 167
- Global Const $wm_ncmbuttonup = 168
- Global Const $wm_ondblclkndblclk = 169
- Global Const $wm_ncxbuttondown = 171
- Global Const $wm_ncxbuttonup = 172
- Global Const $wm_ondblclkndblclk = 173
- Global Const $wm_nwcaptioncaption = 174
- Global Const $wmrawframeawframe = 175
- Global Const $wm_inpue_change_change = 254
- Global Const $wm_input = 255
- Global Const $wm_keydown = 256
- Global Const $wm_keyfirst = 256
- Global Const $wm_keyup = 257
- Global Const $wm_char = 258
- Global Const $wm_deadchar = 259
- Global Const $wm_syskeydown = 260
- Global Const $wm_syskeyup = 261
- Global Const $wm_syschar = 262
- Global Const $wm_sysdeadchar = 263
- Global Const $wm_yomichar = 264
- Global Const $wm_keylast = 265
- Global Const $wm_unichar = 265
- Global Const $wmtrequestrequest = 266
- Global Const $wm_convertresult = 267
- Global Const $wm_im_info = 268
- Global Const $wm_ime_spositionosition = 269
- Global Const $wm_imepositionosition = 270
- Global Const $wm_positionosition = 271
- Global Const $wm_ime_keylast = 271
- Global Const $wm_initdialog = 272
- Global Const $wm_command = 273
- Global Const $wm_syscommand = 274
- Global Const $wm_timer = 275
- Global Const $wm_hscroll = 276
- Global Const $wm_vscroll = 277
- Global Const $wm_initmenu = 278
- Global Const $wm_initmenupopup = 279
- Global Const $wm_systimer = 280
- Global Const $wm_gesture = 281
- Global Const $wm_gesturenotify = 282
- Global Const $wm_gestureinput = 283
- Global Const $wm_notifiedotified = 284
- Global Const $wm_menuselect = 287
- Global Const $wm_menuchar = 288
- Global Const $wm_enteridle = 289
- Global Const $wm_menurbuttonup = 290
- Global Const $wm_menudrag = 291
- Global Const $wm_menugetobject = 292
- Global Const $wm_enupopupnupopup = 293
- Global Const $wm_menucommand = 294
- Global Const $wm_changeuistate = 295
- Global Const $wm_updateuistate = 296
- Global Const $wm_queryuistate = 297
- Global Const $wm_lbtrackpoint = 305
- Global Const $wmormsgboxrmsgbox = 306
- Global Const $wm_ctlcoloredit = 307
- Global Const $wm_rlistboxlistbox = 308
- Global Const $wm_ctlcolorbtn = 309
- Global Const $wm_ctlcolordlg = 310
- Global Const $wm_ctcrollbarrollbar = 311
- Global Const $wmorstaticrstatic = 312
- Global Const $mn_gethmenu = 481
- Global Const $wm_parentnotify = 528
- Global Const $wm_entermenuloop = 529
- Global Const $wm_exitmenuloop = 530
- Global Const $wm_nextmenu = 531
- Global Const $wm_sizing = 532
- Global Const $wmechangedchanged = 533
- Global Const $wm_moving = 534
- Global Const $wmroadcastoadcast = 536
- Global Const $wm_devicechange = 537
- Global Const $wm_mdicreate = 544
- Global Const $wm_mdidestroy = 545
- Global Const $wm_mdiactivate = 546
- Global Const $wm_mdirestore = 547
- Global Const $wm_mdinext = 548
- Global Const $wm_mdimaximize = 549
- Global Const $wm_mditile = 550
- Global Const $wm_mdicascade = 551
- Global Const $wmnarrangearrange = 552
- Global Const $wm_mdigetactive = 553
- Global Const $wm_dropobject = 554
- Global Const $wm_opobjectpobject = 555
- Global Const $wm_begindrag = 556
- Global Const $wm_dragloop = 557
- Global Const $wm_dragselect = 558
- Global Const $wm_dragmove = 559
- Global Const $wm_mdisetmenu = 560
- Global Const $wm_entersizemove = 561
- Global Const $wm_exitsizemove = 562
- Global Const $wm_dropfiles = 563
- Global Const $wmreshmenueshmenu = 564
- Global Const $wm_touch = 576
- Global Const $wmtcontextcontext = 641
- Global Const $wm_ime_notify = 642
- Global Const $wm_ime_control = 643
- Global Const $wm_ime_tionfullionfull = 644
- Global Const $wm_ime_select = 645
- Global Const $wm_ime_char = 646
- Global Const $wm_ime_system = 647
- Global Const $wm_ime_request = 648
- Global Const $wm_ime_keydown = 656
- Global Const $wm_ime_keyup = 657
- Global Const $wm_ncmousehover = 672
- Global Const $wm_mousehover = 673
- Global Const $wm_ncmouseleave = 674
- Global Const $wm_mouseleave = 675
- Global Const $wm_wtn_change_change = 689
- Global Const $wm_tablet_first = 704
- Global Const $wm_tablet_last = 735
- Global Const $wm_cut = 768
- Global Const $wm_copy = 769
- Global Const $wm_paste = 770
- Global Const $wm_clear = 771
- Global Const $wm_undo = 772
- Global Const $wm_pachanginghanging = 784
- Global Const $wm_hotkey = 786
- Global Const $wmechangedchanged = 785
- Global Const $wm_sysmenu = 787
- Global Const $wm_hookmsg = 788
- Global Const $wm_exitprocess = 789
- Global Const $wm_wakethread = 790
- Global Const $wm_print = 791
- Global Const $wm_printclient = 792
- Global Const $wm_appcommand = 793
- Global Const $wm_wpalettepalette = 783
- Global Const $wm_themechanged = 794
- Global Const $wm_uahinit = 795
- Global Const $wm_desktopnotify = 796
- Global Const $wm_rdupdatedupdate = 797
- Global Const $wm_dwmcomnchangenchanged = 798
- Global Const $wm_dwmncrgchangegchanged = 799
- Global Const $wm_dwmcolorizatrchangerchanged = 800
- Global Const $wm_dwmwindowedchangedchange = 801
- Global Const $wm_dwmexileframe = 802
- Global Const $wm_dwmsendhumbnaihumbnail = 803
- Global Const $wm_magnif_starte_started = 804
- Global Const $wm_magnon_endedn_ended = 805
- Global Const $wndiconicdiewbitmaewbitmapwbitmap = 806
- Global Const $wm_dwmthumbechangeechanged = 807
- Global Const $wm_magnin_output_output = 808
- Global Const $wmecontrolcontrol = 816
- Global Const $wm_getactiontext = 817
- Global Const $wmdkeydownkeydown = 819
- Global Const $wm_forwardkeyup = 820
- Global Const $wm_gearinfoexrinfoex = 831
- Global Const $wm_notifywow = 832
- Global Const $wm_handheldfirst = 856
- Global Const $wm_handheldlast = 863
- Global Const $wm_afxfirst = 864
- Global Const $wm_afxlast = 895
- Global Const $wm_penwinfirst = 896
- Global Const $wm_penwinlast = 911
- Global Const $wm_dde_initiate = 992
- Global Const $wm_dde_terminate = 993
- Global Const $wm_dde_advise = 994
- Global Const $wm_dde_unadvise = 995
- Global Const $wm_dde_ack = 996
- Global Const $wm_dde_data = 997
- Global Const $wm_dde_request = 998
- Global Const $wm_dde_poke = 999
- Global Const $wm_dde_execute = 1000
- Global Const $wmficationication = 1021
- Global Const $wm_netconnect = 1022
- Global Const $wm_hibernate = 1023
- Global Const $wm_user = 1024
- Global Const $wm_app = 32768
- Global Const $nm_first = 0
- Global Const $nm_outofmemory = $nm_first - 1
- Global Const $nm_click = $nm_first - 2
- Global Const $nm_dblclk = $nm_first - 3
- Global Const $nm_return = $nm_first - 4
- Global Const $nm_rclick = $nm_first - 5
- Global Const $nm_rdblclk = $nm_first - 6
- Global Const $nm_setfocus = $nm_first - 7
- Global Const $nm_killfocus = $nm_first - 8
- Global Const $nm_customdraw = $nm_first - 12
- Global Const $nm_hover = $nm_first - 13
- Global Const $nm_nchittest = $nm_first - 14
- Global Const $nm_keydown = $nm_first - 15
- Global Const $nm_dcapturecapture = $nm_first - 16
- Global Const $nm_setcursor = $nm_first - 17
- Global Const $nm_char = $nm_first - 18
- Global Const $nm_screatedcreated = $nm_first - 19
- Global Const $nm_ldown = $nm_first - 20
- Global Const $nm_rdown = $nm_first - 21
- Global Const $nm_themechanged = $nm_first - 22
- Global Const $wm_mousefirst = 512
- Global Const $wm_mousemove = 512
- Global Const $wm_lbuttondown = 513
- Global Const $wm_lbuttonup = 514
- Global Const $wm_lbuttondblclk = 515
- Global Const $wm_rbuttondown = 516
- Global Const $wm_rbuttonup = 517
- Global Const $wm_rbuttondblclk = 518
- Global Const $wm_mbuttondown = 519
- Global Const $wm_mbuttonup = 520
- Global Const $wm_mbuttondblclk = 521
- Global Const $wm_mousewheel = 522
- Global Const $wm_xbuttondown = 523
- Global Const $wm_xbuttonup = 524
- Global Const $wm_xbuttondblclk = 525
- Global Const $wm_mousehwheel = 526
- Global Const $ps_solid = 0
- Global Const $ps_dash = 1
- Global Const $ps_dot = 2
- Global Const $ps_dashdot = 3
- Global Const $ps_dashdotdot = 4
- Global Const $ps_null = 5
- Global Const $ps_insideframe = 6
- Global Const $ps_userstyle = 7
- Global Const $ps_alternate = 8
- Global Const $ps_endcap_round = 0
- Global Const $ps_endcap_square = 256
- Global Const $ps_endcap_flat = 512
- Global Const $ps_join_bevel = 4096
- Global Const $ps_join_miter = 8192
- Global Const $ps_join_round = 0
- Global Const $ps_geometric = 65536
- Global Const $ps_cosmetic = 0
- Global Const $lwa_alpha = 2
- Global Const $lwa_colorkey = 1
- Global Const $rgn_and = 1
- Global Const $rgn_or = 2
- Global Const $rgn_xor = 3
- Global Const $rgn_diff = 4
- Global Const $rgn_copy = 5
- Global Const $errorregion = 0
- Global Const $nullregion = 1
- Global Const $simpleregion = 2
- Global Const $complexregion = 3
- Global Const $transparent = 1
- Global Const $opaque = 2
- Global Const $ccm_first = 8192
- Global Const $ccm_gdeformateformat = ($ccm_first + 6)
- Global Const $ccm_sdeformateformat = ($ccm_first + 5)
- Global Const $ccm_setbkcolor = $ccm_first + 1
- Global Const $ccmorschemerscheme = $ccm_first + 2
- Global Const $ccmorschemerscheme = $ccm_first + 3
- Global Const $ccoptargetptarget = $ccm_first + 4
- Global Const $ccmdowthemeowtheme = $ccm_first + 11
- Global Const $ga_parent = 1
- Global Const $ga_root = 2
- Global Const $ga_rootowner = 3
- Global Const $sm_cxscreen = 0
- Global Const $sm_cyscreen = 1
- Global Const $sm_cxvscroll = 2
- Global Const $sm_cyhscroll = 3
- Global Const $sm_cycaption = 4
- Global Const $sm_cxborder = 5
- Global Const $sm_cyborder = 6
- Global Const $sm_cxdlgframe = 7
- Global Const $sm_cydlgframe = 8
- Global Const $sm_cyvthumb = 9
- Global Const $sm_cxhthumb = 10
- Global Const $sm_cxicon = 11
- Global Const $sm_cyicon = 12
- Global Const $sm_cxcursor = 13
- Global Const $sm_cycursor = 14
- Global Const $sm_cymenu = 15
- Global Const $sm_cxfullscreen = 16
- Global Const $sm_cyfullscreen = 17
- Global Const $sm_cykanjiwindow = 18
- Global Const $sm_mousepresent = 19
- Global Const $sm_cyvscroll = 20
- Global Const $sm_cxhscroll = 21
- Global Const $sm_debug = 22
- Global Const $sm_swapbutton = 23
- Global Const $sm_reserved1 = 24
- Global Const $sm_reserved2 = 25
- Global Const $sm_reserved3 = 26
- Global Const $sm_reserved4 = 27
- Global Const $sm_cxmin = 28
- Global Const $sm_cymin = 29
- Global Const $sm_cxsize = 30
- Global Const $sm_cysize = 31
- Global Const $sm_cxframe = 32
- Global Const $sm_cyframe = 33
- Global Const $sm_cxmintrack = 34
- Global Const $sm_cymintrack = 35
- Global Const $sm_cxdoubleclk = 36
- Global Const $sm_cydoubleclk = 37
- Global Const $sm_cxiconspacing = 38
- Global Const $sm_cyiconspacing = 39
- Global Const $sm_melignmentignment = 40
- Global Const $sm_penwindows = 41
- Global Const $sm_dbcsenabled = 42
- Global Const $sm_cmousebuttons = 43
- Global Const $sm_secure = 44
- Global Const $sm_cxedge = 45
- Global Const $sm_cyedge = 46
- Global Const $sm_cxminspacing = 47
- Global Const $sm_cyminspacing = 48
- Global Const $sm_cxsmicon = 49
- Global Const $sm_cysmicon = 50
- Global Const $sm_cysmcaption = 51
- Global Const $sm_cxsmsize = 52
- Global Const $sm_cysmsize = 53
- Global Const $sm_cxmenusize = 54
- Global Const $sm_cymenusize = 55
- Global Const $sm_arrange = 56
- Global Const $sm_cxminimized = 57
- Global Const $sm_cyminimized = 58
- Global Const $sm_cxmaxtrack = 59
- Global Const $sm_cymaxtrack = 60
- Global Const $sm_cxmaximized = 61
- Global Const $sm_cymaximized = 62
- Global Const $sm_network = 63
- Global Const $sm_cleanboot = 67
- Global Const $sm_cxdrag = 68
- Global Const $sm_cydrag = 69
- Global Const $sm_showsounds = 70
- Global Const $sm_cxmenucheck = 71
- Global Const $sm_cymenucheck = 72
- Global Const $sm_slowmachine = 73
- Global Const $smtenabledenabled = 74
- Global Const $sm_molpresentpresent = 75
- Global Const $smalscreenlscreen = 76
- Global Const $smalscreenlscreen = 77
- Global Const $sm_alscreenlscreen = 78
- Global Const $sm_alscreenlscreen = 79
- Global Const $sm_cmonitors = 80
- Global Const $sm_saayformatyformat = 81
- Global Const $sm_immenabled = 82
- Global Const $sm_cxfocusborder = 83
- Global Const $sm_cyfocusborder = 84
- Global Const $sm_tabletpc = 86
- Global Const $sm_mediacenter = 87
- Global Const $sm_starter = 88
- Global Const $sm_serverr2 = 89
- Global Const $sm_cmetrics = 90
- Global Const $sm_remotesession = 4096
- Global Const $sm_shuttingdown = 8192
- Global Const $sm_remotecontrol = 8193
- Global Const $sm_caretgenabledenabled = 8194
- Global Const $blackness = 66
- Global Const $captureblt = 1073741824
- Global Const $dstinvert = 5570569
- Global Const $mergecopy = 12583114
- Global Const $mergepaint = 12255782
- Global Const $nomirrorbitmap = -2147483648
- Global Const $notsrccopy = 3342344
- Global Const $notsrcerase = 1114278
- Global Const $patcopy = 15728673
- Global Const $patinvert = 5898313
- Global Const $patpaint = 16452105
- Global Const $srcand = 8913094
- Global Const $srccopy = 13369376
- Global Const $srcerase = 4457256
- Global Const $srcinvert = 6684742
- Global Const $srcpaint = 15597702
- Global Const $whiteness = 16711778
- Global Const $dt_bottom = 8
- Global Const $dt_calcrect = 1024
- Global Const $dt_center = 1
- Global Const $dt_editcontrol = 8192
- Global Const $dt_end_ellipsis = 32768
- Global Const $dt_expandtabs = 64
- Global Const $dt_lleadingleading = 512
- Global Const $dt_hideprefix = 1048576
- Global Const $dt_internal = 4096
- Global Const $dt_left = 0
- Global Const $dt_modifystring = 65536
- Global Const $dt_noclip = 256
- Global Const $dt_nofulharbreakarbreak = 524288
- Global Const $dt_noprefix = 2048
- Global Const $dt_path_ellipsis = 16384
- Global Const $dt_prefixonly = 2097152
- Global Const $dt_right = 2
- Global Const $dt_rtlreading = 131072
- Global Const $dt_singleline = 32
- Global Const $dt_tabstop = 128
- Global Const $dt_top = 0
- Global Const $dt_vcenter = 4
- Global Const $dt_wordbreak = 16
- Global Const $dt_word_ellipsis = 262144
- Global Const $rdw_erase = 4
- Global Const $rdw_frame = 1024
- Global Const $rdnalpaintalpaint = 2
- Global Const $rdw_invalidate = 1
- Global Const $rdw_noerase = 32
- Global Const $rdw_noframe = 2048
- Global Const $rdw_nalpaintalpaint = 16
- Global Const $rdw_validate = 8
- Global Const $rdw_erasenow = 512
- Global Const $rdw_updatenow = 256
- Global Const $rdw_allchildren = 128
- Global Const $rdw_nochildren = 64
- Global Const $wm_renderformat = 773
- Global Const $wm_rlformatsformats = 774
- Global Const $wm_dlipboardipboard = 775
- Global Const $wm_drawclipboard = 776
- Global Const $wmlipboardipboard = 777
- Global Const $wm_vlipboardipboard = 778
- Global Const $wm_sizeclipboard = 779
- Global Const $wm_rmatnamematname = 780
- Global Const $wm_changecbchain = 781
- Global Const $wm_hlipboardipboard = 782
- Global Const $hterror = -2
- Global Const $httransparent = -1
- Global Const $htnowhere = 0
- Global Const $htclient = 1
- Global Const $htcaption = 2
- Global Const $htsysmenu = 3
- Global Const $htgrowbox = 4
- Global Const $htsize = $htgrowbox
- Global Const $htmenu = 5
- Global Const $hthscroll = 6
- Global Const $htvscroll = 7
- Global Const $htminbutton = 8
- Global Const $htmaxbutton = 9
- Global Const $htleft = 10
- Global Const $htright = 11
- Global Const $httop = 12
- Global Const $httopleft = 13
- Global Const $httopright = 14
- Global Const $htbottom = 15
- Global Const $htbottomleft = 16
- Global Const $htbottomright = 17
- Global Const $htborder = 18
- Global Const $htreduce = $htminbutton
- Global Const $htzoom = $htmaxbutton
- Global Const $htsizefirst = $htleft
- Global Const $htsizelast = $htbottomright
- Global Const $htobject = 19
- Global Const $htclose = 20
- Global Const $hthelp = 21
- Global Const $color_scrollbar = 0
- Global Const $color_background = 1
- Global Const $coloecaptioncaption = 2
- Global Const $color_ecaptioncaption = 3
- Global Const $color_menu = 4
- Global Const $color_window = 5
- Global Const $codowframeowframe = 6
- Global Const $color_menutext = 7
- Global Const $color_windowtext = 8
- Global Const $cotiontextiontext = 9
- Global Const $colvebordereborder = 10
- Global Const $colorvebordereborder = 11
- Global Const $colorkspacerkspace = 12
- Global Const $color_highlight = 13
- Global Const $coloighttextghttext = 14
- Global Const $color_btnface = 15
- Global Const $color_btnshadow = 16
- Global Const $color_graytext = 17
- Global Const $color_btntext = 18
- Global Const $color_inactiontextiontext = 19
- Global Const $colighlightghlight = 20
- Global Const $color_3ddkshadow = 21
- Global Const $color_3dlight = 22
- Global Const $color_infotext = 23
- Global Const $color_infobk = 24
- Global Const $color_hotlight = 26
- Global Const $color_gradieecaptioecaption = 27
- Global Const $color_gradientecaptioecaption = 28
- Global Const $couhilighthilight = 29
- Global Const $color_menubar = 30
- Global Const $color_desktop = 1
- Global Const $color_3dface = 15
- Global Const $color_3dshadow = 16
- Global Const $coighlightghlight = 20
- Global Const $color_3dhilight = 20
- Global Const $color_btnhilight = 20
- Global Const $hinst_commctrl = -1
- Global Const $idb_ll_colorl_color = 0
- Global Const $idb_ge_colore_color = 1
- Global Const $idb_vll_colorl_color = 4
- Global Const $idb_vge_colore_color = 5
- Global Const $idb_hll_colorl_color = 8
- Global Const $idb_hge_colore_color = 9
- Global Const $startf_ffeedbackeedback = 128
- Global Const $startf_feedbackeedback = 64
- Global Const $startftpinningpinning = 8192
- Global Const $startllscreenlscreen = 32
- Global Const $stareisappidisappid = 4096
- Global Const $startf_linknameinkname = 2048
- Global Const $startuntcharsntchars = 8
- Global Const $startf_uttributetribute = 16
- Global Const $startf_usehotkey = 512
- Global Const $stapositionosition = 4
- Global Const $startowwindowwwindow = 1
- Global Const $startf_usesize = 2
- Global Const $startdhandleshandles = 256
- Global Const $cdds_prepaint = 1
- Global Const $cdds_postpaint = 2
- Global Const $cdds_preerase = 3
- Global Const $cdds_posterase = 4
- Global Const $cdds_item = 65536
- Global Const $cdprepaintrepaint = 65537
- Global Const $cddostpaintstpaint = 65538
- Global Const $cdpreerasereerase = 65539
- Global Const $cddosterasesterase = 65540
- Global Const $cdds_subitem = 131072
- Global Const $cdis_selected = 1
- Global Const $cdis_grayed = 2
- Global Const $cdis_disabled = 4
- Global Const $cdis_checked = 8
- Global Const $cdis_focus = 16
- Global Const $cdis_default = 32
- Global Const $cdis_hot = 64
- Global Const $cdis_marked = 128
- Global Const $cdierminaterminate = 256
- Global Const $cdis_soardcuesardcues = 512
- Global Const $cdis_nearhot = 1024
- Global Const $cdrsidehotsidehot = 2048
- Global Const $cdis_drophilited = 4096
- Global Const $cdrf_dodefault = 0
- Global Const $cdrf_newfont = 2
- Global Const $cdrf_skipdefault = 4
- Global Const $cdrf_ostpaintstpaint = 16
- Global Const $cdrfitemdrawtemdraw = 32
- Global Const $cdrf_noitemdrawtemdraw = 32
- Global Const $cdrf_osterasesterase = 64
- Global Const $cdrf_doerase = 8
- Global Const $cdrostpaintstpaint = 256
- Global Const $guiault_guiult_gui = BitOR($ws_minimizebox, $ws_caption, $ws_popup, $ws_sysmenu)
- Global Const $gmem_fixed = 0
- Global Const $gmem_moveable = 2
- Global Const $gmem_nocompact = 16
- Global Const $gmem_nodiscard = 32
- Global Const $gmem_zeroinit = 64
- Global Const $gmem_modify = 128
- Global Const $gmem_discardable = 256
- Global Const $gmem_not_banked = 4096
- Global Const $gmem_share = 8192
- Global Const $gmem_ddeshare = 8192
- Global Const $gmem_notify = 16384
- Global Const $gmem_lower = 4096
- Global Const $gmem_valid_flags = 32626
- Global Const $gmemd_handle_handle = 32768
- Global Const $gptr = BitOR($gmem_fixed, $gmem_zeroinit)
- Global Const $ghnd = BitOR($gmem_moveable, $gmem_zeroinit)
- Global Const $mem_commit = 4096
- Global Const $mem_reserve = 8192
- Global Const $mem_top_down = 1048576
- Global Const $mem_shared = 134217728
- Global Const $page_noaccess = 1
- Global Const $page_readonly = 2
- Global Const $page_readwrite = 4
- Global Const $page_execute = 16
- Global Const $paute_readte_read = 32
- Global Const $page_exeadwriteadwrite = 64
- Global Const $page_exritecopyitecopy = 128
- Global Const $page_guard = 256
- Global Const $page_nocache = 512
- Global Const $paecombinecombine = 1024
- Global Const $page_writecopy = 8
- Global Const $mem_decommit = 16384
- Global Const $mem_release = 32768
- Global Const $prerminaterminate = 1
- Global Const $procese_thread_thread = 2
- Global Const $procesessionidssionid = 4
- Global Const $proceperationeration = 8
- Global Const $process_vm_read = 16
- Global Const $process_vm_write = 32
- Global Const $prop_handle_handle = 64
- Global Const $process_processprocess = 128
- Global Const $pret_quotat_quota = 256
- Global Const $process_ormationrmation = 512
- Global Const $process_quormatioormation = 1024
- Global Const $pquery_liuiormatioormationrmation = 4096
- Global Const $processd_resume_resume = 2048
- Global Const $prol_access_access = 2035711
- Global Const $se_assignprken_namken_name = "SeAssignPrimarrivilegrivilege"
- Global Const $se_audit_name = "SeAuditPrivilege"
- Global Const $se_backup_name = "Serivilegeivilege"
- Global Const $se_chaify_namefy_name = "SeChangerivilegeivilege"
- Global Const $se_crebal_nameal_name = "SeCreaterivilegeivilege"
- Global Const $se_creatile_namele_name = "SeCreateParivilegrivilege"
- Global Const $se_createent_nament_name = "SeCreatePerrivilegrivilege"
- Global Const $se_create_symink_namink_name = "SeCreateSymbolrivilegrivilege"
- Global Const $se_crken_nameen_name = "SeCreatrivilegeivilege"
- Global Const $se_debug_name = "SeDebugPrivilege"
- Global Const $se_enable_ion_namion_name = "SeEnableDelerivilegrivilege"
- Global Const $se_iate_namete_name = "SeImperrivilegeivilege"
- Global Const $se_inc_basity_namity_name = "SeIncreaseBasePrrivilegrivilege"
- Global Const $se_inc_wset_nameet_name = "SeIncreaseWorkrivilegrivilege"
- Global Const $se_incrota_nameta_name = "SeIncreasrivilegrivilege"
- Global Const $se_lver_nameer_name = "SeLoadrivilegeivilege"
- Global Const $se_lory_namery_name = "SeLockrivilegeivilege"
- Global Const $se_machiunt_nament_name = "SeMachineArivilegrivilege"
- Global Const $se_manume_nameme_name = "SeManagerivilegeivilege"
- Global Const $se_prof_singess_namess_name = "SeProfileSinglePrivilegrivilege"
- Global Const $se_relabel_name = "SeRrivilegeivilege"
- Global Const $se_remotown_namewn_name = "SeRemoteShrivilegrivilege"
- Global Const $se_restore_name = "SeRrivilegeivilege"
- Global Const $se_security_name = "SeSerivilegeivilege"
- Global Const $se_shutdown_name = "SeShrivilegeivilege"
- Global Const $se_ent_nament_name = "SeSynrivilegeivilege"
- Global Const $se_system_eent_nament_name = "SeSystemEnvirrivilegrivilege"
- Global Const $se_systile_namele_name = "SeSystemPrivilegrivilege"
- Global Const $se_ime_nameme_name = "SeSystrivilegeivilege"
- Global Const $se_takehip_nameip_name = "SeTakeOwnrivilegrivilege"
- Global Const $se_tcb_name = "SeTcbPrivilege"
- Global Const $seone_namene_name = "SeTirivilegeivilege"
- Global Const $se_trusted_credess_namess_name = "SeTrustedCredManrivilegrivilege"
- Global Const $se_unsolicput_namput_name = "SeUnsoliciterivilegrivilege"
- Global Const $se_undock_name = "Serivilegeivilege"
- Global Const $se_privilege_ena_defaul_default = 1
- Global Const $se_pr_enabledenabled = 2
- Global Const $se_pr_removedremoved = 4
- Global Const $se_privilege_r_accesr_access = -2147483648
- Global Const $se_andatoryndatory = 1
- Global Const $se_group_ena_defaul_default = 2
- Global Const $se_group_enabled = 4
- Global Const $se_group_owner = 8
- Global Const $se_group_useny_onleny_only = 16
- Global Const $se_ntegritytegrity = 32
- Global Const $se_group_in_enable_enabled = 64
- Global Const $seresourceesource = 536870912
- Global Const $selogon_idogon_id = -1073741824
- Global Enum $tokenprimary = 1, $toksonationonation
- Global Enum $senonymousonymous = 0, $securitficationication, $securisonationonation, $seclegationegation
- Global Enum $tokenuser = 1, $tokengroups, $tokenprivileges, $tokenowner, $toarygrouprygroup, $tokendefaultdacl, $tokensource, $tokentype, $tokenimpionlevelonlevel, $tokenstatistics, $tokectedsidstedsids, $tokensessionid, $tokengrouivilegeivileges, $tokenseferenceference, $toboxinertoxinert, $tokenauditpolicy, $tokenorigin, $toktiontypeiontype, $tokenlinkedtoken, $tokenelevation, $tokenrictionsictions, $tokenacormationrmation, $tokenvirtuanallowenallowed, $tokenvirtuanenablenenabled, $tokeityleveltylevel, $tokenuiaccess, $tokenrypolicyypolicy, $tokenlogonsid
- Global Const $token_primaryprimary = 1
- Global Const $token_duplicate = 2
- Global Const $toersonatersonate = 4
- Global Const $token_query = 8
- Global Const $toky_source_source = 16
- Global Const $token_adivilegesvileges = 32
- Global Const $toket_groups_groups = 64
- Global Const $token_defaultdefault = 128
- Global Const $token_aessionidssionid = 256
- Global Const $token_all_access = 983551
- Global Const $token_read = 131080
- Global Const $token_write = 131296
- Global Const $token_execute = 131072
- Global Const $token_has_trarivilegrivilege = 1
- Global Const $token_has_brivilegrivilege = 2
- Global Const $token_has_rerivilegrivilege = 4
- Global Const $token_in_groupn_group = 8
- Global Const $tokestrictedtricted = 16
- Global Const $token_sessionferenceferenced = 32
- Global Const $tokeox_inertx_inert = 64
- Global Const $token_has_impersrivilegrivilege = 128
- Global Const $rights_delete = 65536
- Global Const $read_control = 131072
- Global Const $write_dac = 262144
- Global Const $write_owner = 524288
- Global Const $synchronize = 1048576
- Global Const $access_securityecurity = 16777216
- Global Const $standard_requirerequired = 983040
- Global Const $standhts_readts_read = $read_control
- Global Const $standats_writes_write = $read_control
- Global Const $standard_executeexecute = $read_control
- Global Const $stanghts_allhts_all = 2031616
- Global Const $specghts_allhts_all = 65535
- Global Enum $not_used_access = 0, $grant_access, $set_access, $deny_access, $revoke_access, $se_successsuccess, $se_failurefailure
- Global Enum $tru_unknownunknown = 0, $trustee_is_user, $trustee_is_group, $trs_domain_domain, $trustee_is_alias, $trustee_is_wwn_grouwn_group, $tru_deleteddeleted, $tru_invalidinvalid, $truscomputeromputer
- Global Const $log_profileprofile = 1
- Global Const $logon_netcals_onlals_only = 2
- Global Enum $sidtypeuser = 1, $sidtypegroup, $sidtypedomain, $sidtypealias, $sidtypowngroupwngroup, $sidtypdaccountaccount, $sidtypeinvalid, $sidtypeunknown, $sidtypecomputer, $sidtypelabel
- Global Const $sidstratorstrators = "S-1-5-32-544"
- Global Const $sid_users = "S-1-5-32-545"
- Global Const $sid_guests = "S-1-5-32-546"
- Global Const $sid_acperatorserators = "S-1-5-32-548"
- Global Const $sid_speratorserators = "S-1-5-32-549"
- Global Const $sid_peratorserators = "S-1-5-32-550"
- Global Const $sid_bperatorserators = "S-1-5-32-551"
- Global Const $sid_replicator = "S-1-5-32-552"
- Global Const $sid_owner = "S-1-3-0"
- Global Const $sid_everyone = "S-1-1-0"
- Global Const $sid_network = "S-1-5-2"
- Global Const $sid_interactive = "S-1-5-4"
- Global Const $sid_system = "S-1-5-18"
- Global Const $sid_authed_usersd_users = "S-1-5-11"
- Global Const $sid_schannelticatiotication = "S-1-5-64-14"
- Global Const $sid_digestticatiotication = "S-1-5-64-21"
- Global Const $sid_nt_service = "S-1-5-80"
- Global Const $sid_untrusted_ry_levery_level = "S-1-16-0"
- Global Const $sid_low_ry_levely_level = "S-1-16-4096"
- Global Const $sid_medium_ry_levery_level = "S-1-16-8192"
- Global Const $sid_medium_plus_ry_levery_level = "S-1-16-8448"
- Global Const $sid_high_ry_levery_level = "S-1-16-12288"
- Global Const $sid_system_ry_levery_level = "S-1-16-16384"
- Global Const $sid_pd_prcted__ry_levery_levely_level = "S-1-16-20480"
- Global Const $sie_procee__ry_levery_levely_level = "S-1-16-28672"
- Global Const $sid_all_services = "S-1-5-80-0"
- Func _winapi_getlasterror($ierror = @error, $iextended = @extended)
- Local $aresult = DllCall("kernel32.dll", "dword", "GetLastError")
- Return SetError($ierror, $iextended, $aresult[0])
- EndFunc
- Func _winapi_setlasterror($ierrorcode, $ierror = @error, $iextended = @extended)
- DllCall("kernel32.dll", "none", "SetLastError", "dword", $ierrorcode)
- Return SetError($ierror, $iextended, NULL )
- EndFunc
- Func _security__adjusttokenprivileges($htoken, $bdisableall, $pnewstate, $ibufferlen, $pprevstate = 0, $prequired = 0)
- Local $acall = DllCall("advapi32.dll", "bool", "Adjustivilegesvileges", "handle", $htoken, "bool", $bdisableall, "struct*", $pnewstate, "dword", $ibufferlen, "struct*", $pprevstate, "struct*", $prequired)
- If @error Then Return SetError(@error, @extended, False)
- Return NOT ($acall[0] = 0)
- EndFunc
- Func _security__createprocesswithtoken($htoken, $ilogonflags, $scommandline, $icreationflags, $scurdir, $tstartupinfo, $tprocormationrmation)
- Local $acall = DllCall("advapi32.dll", "bool", "CreatePrthTokenWhTokenW", "handle", $htoken, "dword", $ilogonflags, "ptr", 0, "wstr", $scommandline, "dword", $icreationflags, "struct*", 0, "wstr", $scurdir, "struct*", $tstartupinfo, "struct*", $tprocormationrmation)
- If @error OR NOT $acall[0] Then Return SetError(@error, @extended, False)
- Return True
- EndFunc
- Func _security__duplicatetokenex($hexistingtoken, $idesiredaccess, $iimpionlevelonlevel, $itokentype)
- Local $acall = DllCall("advapi32.dll", "bool", "DuplicateTokenEx", "handle", $hexistingtoken, "dword", $idesiredaccess, "struct*", 0, "int", $iimpionlevelonlevel, "int", $itokentype, "handle*", 0)
- If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
- Return $acall[6]
- EndFunc
- Func _security__getaccountsid($saccount, $ssystem = "")
- Local $aacct = _security__lookupaccountname($saccount, $ssystem)
- If @error Then Return SetError(@error, @extended, 0)
- If IsArray($aacct) Then Return _security__stringsidtosid($aacct[0])
- Return ""
- EndFunc
- Func _security__getlengthsid($psid)
- If NOT _security__isvalidsid($psid) Then Return SetError(@error + 10, @extended, 0)
- Local $acall = DllCall("advapi32.dll", "dword", "GetLengthSid", "struct*", $psid)
- If @error Then Return SetError(@error, @extended, 0)
- Return $acall[0]
- EndFunc
- Func _security__gettokeninformation($htoken, $iclass)
- Local $acall = DllCall("advapi32.dll", "bool", "GetTormationrmation", "handle", $htoken, "int", $iclass, "struct*", 0, "dword", 0, "dword*", 0)
- If @error OR NOT $acall[5] Then Return SetError(@error + 10, @extended, 0)
- Local $ilen = $acall[5]
- Local $tbuffer = DllStructCreate("byte[" & $ilen & "]")
- $acall = DllCall("advapi32.dll", "bool", "GetTormationrmation", "handle", $htoken, "int", $iclass, "struct*", $tbuffer, "dword", DllStructGetSize($tbuffer), "dword*", 0)
- If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
- Return $tbuffer
- EndFunc
- Func _security__impersonateself($ilevel = $securisonationonation)
- Local $acall = DllCall("advapi32.dll", "bool", "ImpersonateSelf", "int", $ilevel)
- If @error Then Return SetError(@error, @extended, False)
- Return NOT ($acall[0] = 0)
- EndFunc
- Func _security__isvalidsid($psid)
- Local $acall = DllCall("advapi32.dll", "bool", "IsValidSid", "struct*", $psid)
- If @error Then Return SetError(@error, @extended, False)
- Return NOT ($acall[0] = 0)
- EndFunc
- Func _security__lookupaccountname($saccount, $ssystem = "")
- Local $tdata = DllStructCreate("byte SID[256]")
- Local $acall = DllCall("advapi32.dll", "bool", "LoountNameWntNameW", "wstr", $ssystem, "wstr", $saccount, "struct*", $tdata, "dword*", DllStructGetSize($tdata), "wstr", "", "dword*", DllStructGetSize($tdata), "int*", 0)
- If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
- Local $aacct[3]
- $aacct[0] = _security__sidtostringsid(DllStructGetPtr($tdata, "SID"))
- $aacct[1] = $acall[5]
- $aacct[2] = $acall[7]
- Return $aacct
- EndFunc
- Func _security__lookupaccountsid($vsid, $ssystem = "")
- Local $psid, $aacct[3]
- If IsString($vsid) Then
- $psid = _security__stringsidtosid($vsid)
- Else
- $psid = $vsid
- EndIf
- If NOT _security__isvalidsid($psid) Then Return SetError(@error + 10, @extended, 0)
- Local $stypesystem = "ptr"
- If $ssystem Then $stypesystem = "wstr"
- Local $acall = DllCall("advapi32.dll", "bool", "LoountSidWuntSidW", $stypesystem, $ssystem, "struct*", $psid, "wstr", "", "dword*", 65536, "wstr", "", "dword*", 65536, "int*", 0)
- If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
- Local $aacct[3]
- $aacct[0] = $acall[3]
- $aacct[1] = $acall[5]
- $aacct[2] = $acall[7]
- Return $aacct
- EndFunc
- Func _security__lookupprivilegevalue($ssystem, $sname)
- Local $acall = DllCall("advapi32.dll", "bool", "LookupgeValueWeValueW", "wstr", $ssystem, "wstr", $sname, "int64*", 0)
- If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
- Return $acall[3]
- EndFunc
- Func _security__openprocesstoken($hprocess, $iaccess)
- Local $acall = DllCall("advapi32.dll", "bool", "OpenProcessToken", "handle", $hprocess, "dword", $iaccess, "handle*", 0)
- If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
- Return $acall[3]
- EndFunc
- Func _security__openthreadtoken($iaccess, $hthread = 0, $bopenasself = False)
- If $hthread = 0 Then
- Local $aresult = DllCall("kernel32.dll", "handle", "GetCurrentThread")
- If @error Then Return SetError(@error + 10, @extended, 0)
- $hthread = $aresult[0]
- EndIf
- Local $acall = DllCall("advapi32.dll", "bool", "OpenThreadToken", "handle", $hthread, "dword", $iaccess, "bool", $bopenasself, "handle*", 0)
- If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
- Return $acall[4]
- EndFunc
- Func _security__openthreadtokenex($iaccess, $hthread = 0, $bopenasself = False)
- Local $htoken = _security__openthreadtoken($iaccess, $hthread, $bopenasself)
- If $htoken = 0 Then
- Local Const $error_no_token = 1008
- If _winapi_getlasterror() <> $error_no_token Then Return SetError(20, _winapi_getlasterror(), 0)
- If NOT _security__impersonateself() Then Return SetError(@error + 10, _winapi_getlasterror(), 0)
- $htoken = _security__openthreadtoken($iaccess, $hthread, $bopenasself)
- If $htoken = 0 Then Return SetError(@error, _winapi_getlasterror(), 0)
- EndIf
- Return $htoken
- EndFunc
- Func _security__setprivilege($htoken, $sprivilege, $benable)
- Local $iluid = _security__lookupprivilegevalue("", $sprivilege)
- If $iluid = 0 Then Return SetError(@error + 10, @extended, False)
- Local Const $tagtivilegesvileges = "dword Count;align 4;int6dtributetributetributes"
- Local $tcurrstate = DllStructCreate($tagtivilegesvileges)
- Local $icurrstate = DllStructGetSize($tcurrstate)
- Local $tprevstate = DllStructCreate($tagtivilegesvileges)
- Local $iprevstate = DllStructGetSize($tprevstate)
- Local $trequired = DllStructCreate("int Data")
- DllStructSetData($tcurrstate, "Count", 1)
- DllStructSetData($tcurrstate, "LUID", $iluid)
- If NOT _security__adjusttokenprivileges($htoken, False, $tcurrstate, $icurrstate, $tprevstate, $trequired) Then Return SetError(2, @error, False)
- DllStructSetData($tprevstate, "Count", 1)
- DllStructSetData($tprevstate, "LUID", $iluid)
- Local $iattributes = DllStructGetData($tprevstate, "Attributes")
- If $benable Then
- $iattributes = BitOR($iattributes, $se_pr_enabledenabled)
- Else
- $iattributes = BitAND($iattributes, BitNOT($se_pr_enabledenabled))
- EndIf
- DllStructSetData($tprevstate, "Attributes", $iattributes)
- If NOT _security__adjusttokenprivileges($htoken, False, $tprevstate, $iprevstate, $tcurrstate, $trequired) Then Return SetError(3, @error, False)
- Return True
- EndFunc
- Func _security__settokeninformation($htoken, $itormationrmation, $vtormationrmation, $itokeninonlengthnlength)
- Local $acall = DllCall("advapi32.dll", "bool", "SetTormationrmation", "handle", $htoken, "int", $itormationrmation, "struct*", $vtormationrmation, "dword", $itokeninonlengthnlength)
- If @error OR NOT $acall[0] Then Return SetError(@error, @extended, False)
- Return True
- EndFunc
- Func _security__sidtostringsid($psid)
- If NOT _security__isvalidsid($psid) Then Return SetError(@error + 10, 0, "")
- Local $acall = DllCall("advapi32.dll", "bool", "ConvertringSidWingSidW", "struct*", $psid, "ptr*", 0)
- If @error OR NOT $acall[0] Then Return SetError(@error, @extended, "")
- Local $pstringsid = $acall[2]
- Local $alen = DllCall("kernel32.dll", "int", "lstrlenW", "struct*", $pstringsid)
- Local $ssid = DllStructGetData(DllStructCreate("wchar Text[" & $alen[0] + 1 & "]", $pstringsid), "Text")
- DllCall("kernel32.dll", "handle", "LocalFree", "handle", $pstringsid)
- Return $ssid
- EndFunc
- Func _security__sidtypestr($itype)
- Switch $itype
- Case $sidtypeuser
- Return "User"
- Case $sidtypegroup
- Return "Group"
- Case $sidtypedomain
- Return "Domain"
- Case $sidtypealias
- Return "Alias"
- Case $sidtypowngroupwngroup
- Return "Well Known Group"
- Case $sidtypdaccountaccount
- Return "Deleted Account"
- Case $sidtypeinvalid
- Return "Invalid"
- Case $sidtypeunknown
- Return "Unknown Type"
- Case $sidtypecomputer
- Return "Computer"
- Case $sidtypelabel
- Return "A mandatory inteabel SIabel SID"
- Case Else
- Return "Unknown SID Type"
- EndSwitch
- EndFunc
- Func _security__stringsidtosid($ssid)
- Local $acall = DllCall("advapi32.dll", "bool", "ConvertidToSidWdToSidW", "wstr", $ssid, "ptr*", 0)
- If @error OR NOT $acall[0] Then Return SetError(@error, @extended, 0)
- Local $psid = $acall[2]
- Local $tbuffer = DllStructCreate("byte Data[" & _security__getlengthsid($psid) & "]", $psid)
- Local $tsid = DllStructCreate("byte Data[" & DllStructGetSize($tbuffer) & "]")
- DllStructSetData($tsid, "Data", DllStructGetData($tbuffer, "Data"))
- DllCall("kernel32.dll", "handle", "LocalFree", "handle", $psid)
- Return $tsid
- EndFunc
- Global Const $tagpoint = "struct;long X;lndstrucndstruct"
- Global Const $tagrect = "struct;long Left;long Top;long RighBndstruBndstrucndstruct"
- Global Const $tagsize = "struct;long X;lndstrucndstruct"
- Global Const $tagmargins = "int cdth;int cxRightWidthhtWt cyTopHecyTopHetomHeigtomHeighomHeight"
- Global Const $tagfiletime = "stord Lo;orondstrucndstructdstruct"
- Global Const $tagsystemtime = "strucYear;word Month;wordth;word Dow;word Day;word Hour;word Mind Second;endstruendstrucndstructdstruct"
- Global Const $tagtime_zormatioormation = "strucBias;wchar StdName[3dName[32];word StdDate[8];long StdBias;wchar DayName[32]ayDate[8]andstruandstruandstrucndstruct"
- Global Const $tagnmhdr = "struct;hwnd hWndFrom;uint_ptr IDTndstruTndstrucndstruct"
- Global Const $taoxexitemxexitem = "uint t_ptr Item;ptr Text;r Text;int TextMax;int Im SelectednayImagnayImagnayImageayImage;" & "int Indeam Paramm Param"
- Global Const $taragbeginagbegin = $tagnmhdr & ";int ItemID;wcext[260ext[260]"
- Global Const $tagnmcbeendedit = $tagnmhdr & ";bool fChanged;int NewSelection;wce;int We;int Wh;int Why"
- Global Const $tagnmcomboboxex = $tagnmhdr & ";uint Mask;int_ptr Item;ptr Textxt Imagxt Imaget Image;" & "int SelectedImage;int OverlayImage;eam Paream Paraam Param"
- Global Const $tagdtprange = "word ;word MinMonth;word h;word MinDOW;wDay;word ;nMinut;nMinutenMinutenMinute;" & "word nd;word MinMSecond;wecond;word MaxYear;word MaxMontMaxDOW;woaMax;woaMaxHouaMaxHourMaxHour;" & "word te;word MaxSecond;wocond;wordcond;booliMaxValiMaxValiMaxValidaxValid"
- Global Const $tagnmechangeechange = $tagnmhdr & ";dword Flag;" & $tagsystemtime
- Global Const $tagnmeformateformat = $tagnmhdr & ";ptr Format;" & $tagsystemtime & ";ptr pDisplay;wcplay[64play[64]"
- Global Const $tagnmdatematquermatquery = $tagnmhdr & ";ptr Format;struct;long Siz ndstru ndstrucndstruct"
- Global Const $tagnmekeydownkeydown = $tagnmhdr & ";int Virt Format Format;" & $tagsystemtime
- Global Const $tagnmestringestring = $tagnmhdr & ";ptr UserString;" & $tagsystemtime & ";dword Flags"
- Global Const $taogrecordgrecord = "dword;dword Reserved;dwored;dword RecordNumber;dword TimeGendword Timord TimnEventInEventIDEventID;" & "word pe;word NumStrings;wrings;word EventCategory;word ReservedFlags;dword RecordNumrgOffsergOffsetgOffsetgOffset;" & "dworddLength;dword UserSi UserSidOword DatadtaOffsdtaOffsetaOffsetaOffset"
- Global Const $taggdip_efams_bluams_blur = "float Radius; pandEdgpandEdge"
- Global Const $taggdippaffectpaicontrascontrastontrast = "int BrsLetnessLnastLeveastLevelstLevel"
- Global Const $teffectpafarbalancrbalancebalance = "int CyanRed; int Magen;llowBlullowBlullowBlue"
- Global Const $taggdip_effectpalorcurvlorcurve = "int Adjustment; int C ustValuustValuustValue"
- Global Const $taggdip_effectcolorlucolorlut = "byte LutB[256]; byte LutG[256]; byte Lu;utA[25;utA[256utA[256]"
- Global Const $taggdip_effectparamsuightnesightnesightness = "int HueLevel; int SaturationLetessLevtessLeveessLevel"
- Global Const $taggdip_effes_levels_levels = "int Hi; iight; tt Shadot Shadow Shadow"
- Global Const $taggdctpaffectrrrectiorrectionrection = "uint NumberOfAtr Areatr Areas"
- Global Const $taggdip_effec_sharpe_sharpen = "float Radiut Amount Amount"
- Global Const $taggdip_efams_tinams_tint = "int t Amount Amount"
- Global Const $tatmapdatamapdata = "uint int Height;int Stridt Stridermat;ptr iReserviReserveReservedeserved"
- Global Const $tagormatrixrmatrix = "float m[25]"
- Global Const $taggderparamerparam = "strucGUID[16];ulong Numbeg NumberO;ulong TyVndstruVndstrucndstructdstruct"
- Global Const $taggderparamsrparams = "uint Count;" & $taggderparamerparam
- Global Const $taggdiprectf = "struct;float X;float Y;float WidthHndstruHndstrucndstruct"
- Global Const $taggtupinputupinput = "uint Version;ptr Callback;boolaNoCodeaNoCodecNoCodecs"
- Global Const $taggdupoutputpoutput = "ptr HookProchookProhookProc"
- Global Const $taggdiodecinfodecinfo = "byte 6];byte FormatID[16]tID[16];ptr CodecName;Name;ptr eFileExeFileExeFileExtFileExt;" & "ptr M;dword Flags;dword Vdword Version;dword SigCount;dgSize;ptrt Sigtrt SigMat SigMas SigMask"
- Global Const $taggdierparamsrparams = "uint Countarams[1arams[1]"
- Global Const $taghditem = "uint t XY;ptr Text;handle;handle hBMP;int TextMax;int Fmt;lparam Param;int Image;intuint Typeint Staint Staint Statnt State"
- Global Const $tagnmhddispinfo = $tagnmhdr & ";int Item;uint Mask;ptr Text;int TextMax;gm lPargm lParam lParam"
- Global Const $tagnmhbtnclicktnclick = $tagnmhdr & ";int Item;" & $tagrect
- Global Const $tagnmheader = $tagnmhdr & ";int Item;int Btr pItetr pItem"
- Global Const $taggetipaddress = "byte Field4;byte Field3;ee Fielde Fielde Field1"
- Global Const $tagnmipaddress = $tagnmhdr & ";int nt Valuet Value"
- Global Const $taglvfindinfo = "struct;ugnt Flagsxm Paramm Paramm Param;" & $tagpoint & ";uint Direndstrucndstruct"
- Global Const $taglvhittestinfo = $tagpoint & ";uint Flags;int Itembt iGrout iGrout iGroup"
- Global Const $taglvitem = "strucMask;int Item;int Su;int SubItem;uint State;uint StateMask;ptr T TextMax;gm Paragm Paramm Param; Param;" & "int Int GroupID;uint Colunt Columns;ptr pCotr piColFindstruindstrucndstrucndstruct"
- Global Const $tagnmlistview = $tagnmhdr & ";int Item;int SubItem;uint NewState;uinttChangetChangedChanged;" & "struct;long ActionX;long ActionYuam Paruam Paraam Param"
- Global Const $tastomdrawtomdraw = "struct;" & $tagnmhdr & ";dword dwDrawStdle hdcdle hdc;" & $tagrect & ";dworwItemSpec;uint uItemt ate;lparal;lparalndstrulndstrucndstruct" & ";dworxt;dword clrTextBk;iextBk;int iSubItem;dword dwe;dword cinEffecinEffecinEffectnEffect;" & "int ise;int iPartId;int id;int iStateId;struct;long TextLeft;long TextTop;long TextRighTextBottort uAtort uAlirt uAligt uAlign"
- Global Const $tagnmlvdispinfo = $tagnmhdr & ";" & $taglvitem
- Global Const $tagnmlvfinditem = $tagnmhdr & ";int Start;" & $taglvfindinfo
- Global Const $tatinfotipinfotip = $tagnmhdr & ";dwor;ptr Text;int TextMa Text Item;i Item;inem lParem lParam lParam"
- Global Const $taactivatectivate = $tagnmhdr & ";int Index;int SubItem;uint NewState;uinttChangetChangedChanged;" & $tagpoint & ";lparam lParaKeyFlagKeyFlags"
- Global Const $tagnmlvkeydown = "align 1;" & $tagnmhdr & ";word nt Flagst Flags"
- Global Const $tagnmlvscroll = $tagnmhdr & ";int DX;int DY"
- Global Const $tagmchittestinfo = "uint Size;" & $tagpoint & ";uint Hit;" & $tagsystemtime & ";" & $tagrect & ";int iOffset;inint iCoint iCol"
- Global Const $tagmcmonthrange = "word ;word MinMonth;word h;word MinDOW;word MinDay;wordr;word Mi;nSecMi;nSecon;nSecondnSecond;" & "word onds;word MaxYear;woYear;word MaxMonth;word MaxDOW;word MaxDay;wordr;word Ma;xSecon;xSecondxSecondxSecond;" & "word MaxMSecort Spaort Span"
- Global Const $tagmcrange = "word ;word MinMonth;word h;word MinDOW;word MinDay;wordr;word Mi;nSecMi;nSecon;nSecondnSecond;" & "word onds;word MaxYear;woYear;word MaxMonth;word MaxDOW;word MaxDay;wordr;word Ma;xSecon;xSecondxSecondxSecond;" & "word MaxMSeconds;shSt MaxSet MaxSet MaxSet"
- Global Const $tagmcselrange = "word ;word MinMonth;word h;word MinDOW;word MinDay;wordr;word Mi;nSecMi;nSecon;nSecondnSecond;" & "word onds;word MaxYear;woYear;word MaxMonth;word MaxDOW;word MaxDay;wordr;word Ma;xSecon;xSecondxSecondxSecond;" & "word MaxMSeconds"
- Global Const $tagnmdaystate = $tagnmhdr & ";" & $tagsystemtime & ";int DayStatDayStatDayState"
- Global Const $tagnmselchange = $tagnmhdr & ";stru BegYear;word BegMon BegMonth;word BegDOW;word BegDay;word BegHour;word BegMinute;worcond;wordcd;wordcdstruccdstructdstruct;" & "strucEndYear;word EndMontEndMonth;word EndDOW;word EndDay;word EndHour;word EndMinute;woecond;worendsworendstruendstrucndstruct"
- Global Const $tactnotifytnotify = $tagnmhdr & ";int Item;ptr piid;ptr pObject;lol dwFlal dwFlag dwFlags"
- Global Const $tagnmtckeydown = "align 1;" & $tagnmhdr & ";word nt Flagst Flags"
- Global Const $tagtvitem = "strucMask;handle hItem;uiItem;uint State;uint StateMask;ptr Text;iMax;int ItedImagtedImageedImage;dImage;" & "inten;lparen ndstrucndstructdstruct"
- Global Const $tagtvitemex = "struct;" & $tagtvitem & ";int l;uint uStateEx;hwndEx;hwnd hwnd;intdedImage;sndstrusndstrucndstrucndstruct"
- Global Const $tagnmtreeview = $tagnmhdr & ";uint Action;" & "strucOldMask;handle OldhIe Oluint Oldint OldSnateMasnateMaskateMask;" & "ptr Oint OldTextMax;int Ox;int OldImage;int OldSelectedImage;intldren;lpaPdstrucPdstructdstruct;struct;" & "strucNewMask;handle NewhIe Neuint Newint NewSnateMasnateMaskateMask;" & "ptr Nint NewTextMax;int Nx;int NewImage;int NewSelectedImage;intldren;lpaPdstrucPdstructdstruct;struct;" & "struct;lnng PointPndstrucndstrucndstruct"
- Global Const $tastomdrawtomdraw = "struct;" & $tagnmhdr & ";dword DrawStdle HDCdle HDC;" & $tagrect & ";dword_ptr ItemSpec;uint ItemState;lpamndstrumndstrucndstruct" & ";dword CdrText;dwTnt Levent Levent Level"
- Global Const $tagnmtvdispinfo = $tagnmhdr & ";" & $tagtvitem
- Global Const $tatinfotipinfotip = $tagnmhdr & ";ptr Text;int TextMax;hanem lParem lParam lParam"
- Global Const $taemchangemchange = $tagnmhdr & ";uintd;handle hItem;uint m;uinNew;uint d lParad lParam lParam;lParam;"
- Global Const $tagtvhittestinfo = $tagpoint & ";uint Fldle Itemle Item"
- Global Const $tagnmtvkeydown = "align 1;" & $tagnmhdr & ";word nt Flagst Flags"
- Global Const $tagnmmouse = $tagnmhdr & ";dword_mSr ItemSrtemDatatemData;emData;" & $tagpoint & ";lparam HitInfo"
- Global Const $tagtivilegesvileges = "dword Count;align 4;int6dtributetributetributes"
- Global Const $tagimageinfo = "handle hBitmap;handle hMask;ieUnusedeUnused2Unused2;" & $tagrect
- Global Const $tagmenuinfo = "dwordNT Mask;dword Style; Style;uint YMax;handle hBackContextHeoMenuDeoMenuDaoMenuDatMenuData"
- Global Const $tagmenuiteminfo = "uint nt Mask;uint Type;uiType;uint State;uint ID;handle SubMenu BmpChecklcheckelcheckedchecked;hecked;" & "ulong_ptr ItemData;ptr TypeData;H BmpItH BmpIte BmpItem"
- Global Const $tagrebarbandinfo = "uint uint fMask;uint fStynt fStyle;dword clrord clrBalint cclint cchint cchint cch;" & "int iwnd hwndChild;uint c;uint cxMinChild;uint cyMinChild;uint cx;handle hbmBackID;uint cuaxChiluaxChiluaxChildaxChild;" & "uint cyIntegral;uint cxIdeal;lparacxHeadacxHeadecxHeader" & ((@OSVersion = "WIN_XP") ? "" : ";" & $tagrect & ";uinronStateonState")
- Global Const $tagnutobreaktobreak = $tagnmhdr & ";uintuint wID;lparam lParam lParam;uint nt fStyle;utoBre;utoBreautoBreautoBreak"
- Global Const $tagnmrbautosize = $tagnmhdr & ";bool fChanged;" & "strucTargetLeft;long Targng TargetTop;long Tght;long odstrucodstructdstructdstruct;" & "strucActualLeft;long Actung ActualTop;long ight;longBndstruBndstrucndstrucndstruct"
- Global Const $tagnmrebar = $tagnmhdr & ";dword dwMask;uint uBand;uint fStyleIm lParIm lParam lParam"
- Global Const $tarchevronchevron = $tagnmhdr & ";uid;uintnd;D lParam lParam;lParam;" & $tagrect & ";lparam lParamNM"
- Global Const $tagnhildsizeildsize = $tagnmhdr & ";uint int wID;nt wID;" & "struct;long CLeft;long CTop;long CRight;odstrucodstructdstruct;" & "struct;long BLeft;long BTop;long BRightBndstruBndstrucndstruct"
- Global Const $tagcolorscheme = "dword Size;dword BtnHi;tnShadotnShadotnShadow"
- Global Const $tagnmtoolbar = $tagnmhdr & ";int iItem;" & "strucBitmap;int idCommandCommand;byte fsState;byte fsStyle;dwodwData;inSndstruSndstrucndstructdstruct" & ";int cchTepszTextpszText;" & $tagrect
- Global Const $tagnmtbhotitem = $tagnmhdr & ";id;int id;e dwFlag dwFlagsdwFlags"
- Global Const $tagtbbutton = "int Bnt Command;byte Statte State;bye;dword_pmr Strimr Strinr String String"
- Global Const $tagtbbuttoninfo = "uint ord Mask;int CommandCommand;int Image;byte State;byte Style;word d_ptr ParT TextMT TextMa TextMa TextMax"
- Global Const $tagnetresource = "dworddword Type;dword Disord DisplayType;dword Usage;ptr LocalName;oteName;peProvideProvideProviderrovider"
- Global Const $tagoverlapped = "ulongternal;ulong_ptr Intptr InternalHigh;struct;dword Offset;dfsetHigh;ce hEvece hEvene hEvent hEvent"
- Global Const $tagopenfilename = "dwordSize;hwnd hwndOwner;dOwner;handle hInstancestrFiltersmFiltesmFiltesmFiltermFilter;" & "dwordstFilter;dword nFiltd nFilterIndex;ptr lpstrFile;dword nMaxFile;trFileTitdleTitldleTitleleTitle;eTitle;" & "ptr ltialDir;ptr lpstrTitpstrTitle;dword Flags;word nFileOffset;word nFileExtetr lpstrDpustDatpustDatpustDataustData;" & "ptr l;ptr lpTemplateName;teName;ptr pvd;dword de Flagse FlagsE FlagsE FlagsEx"
- Global Const $tagbfoheaderoheader = "struc biSize;long biWidthbiWidth;long t;word biwitCounwitCountitCountitCount;" & "dwordression;dword biSize biSizeImage;long biXPelsPerMeter;long biYPelsPerMeter;dword bd;dword bondst bondstruondstrucndstruct"
- Global Const $tagbitmapinfo = $tagbfoheaderoheader & ";dwoBQuad[1]Quad[1]"
- Global Const $tagblendfunction = "byte Op;byte Flagsle Formae Formae Format"
- Global Const $tagguid = "struc Data1;ushort Data2; Datrt Data3t Data3;tndstrutndstrucndstruct"
- Global Const $taglacementacement = "uint uint flags;uint shownt showCmd;long ptMinPosition[2];long pttion[2];loition[oition[4ition[4]tion[4]"
- Global Const $tagwindowpos = "hwnd hWnd;hwnd InsertAfter;int X;int Y;innt Flannt Flagnt Flags"
- Global Const $tagscrollinfo = "uint uint fMask;int nMin;t nMin;intint nPageoTrackPoTrackPoTrackPosrackPos"
- Global Const $tagscrollbarinfo = "dword cbSize;" & $tagrect & ";iineButtin;humbTophumbTop;umbTop;" & "int xyThumbBottom;int redstate[6state[6state[6]"
- Global Const $taglogfont = "strucHeight;long Width;loidth;long Escapement;long Orientation;ight;byte;derlin;derlinederline;erline;" & "byte ut;byte CharSet;byteet;byte OutPrecision;byte ClipPrecision;byte Quality;byte Pitcily;wcharmndstarmndstrumndstrucndstruct"
- Global Const $tagokstructkstruct = "dword;dword scanCode;dworde;dworddword tim_xtraIn_xtraInfxtraInfotraInfo"
- Global Const $tagprocormationrmation = "handle hProcess;handle hThread;dword PDThreadDThreadIThreadID"
- Global Const $tagstartupinfo = "dwordtr Reserved1;ptr Desptr Desktop;ptr Title;dword X;dword Y;dwoe;dword YontCharontCharsntChars;tChars;" & "dwordChars;dword FillAttrillAttribute;dword Flags;word ShowWindow;word R2;ptr ReshtdInpuhtdInputtdInputtdInput;" & "handle StdOutput;StdErroStdError"
- Global Const $tagsecutributesributes = "dword Length;ptr DescrioitHandlitHandlitHandle"
- Global Const $tagind_datand_data = "dwordAttributes;dword ftCord ftCreationTime[2];dword ftLastAccessTime[2];dword ftLastWriteTime[2];dword nFileSizeHigh;dword nFileSizeLow;dword dwReserved0;dword dwReserved1;wchar cFil60];wcharnNamearnName[1nName[14Name[14]"
- Global Const $tagtextmetric = "long t;long tmAscent;longnt;long tmDescent;long tmlLeading;ELeadinELeadinELeadingLeading;" & "long arWidth;long tmMaxChtmMaxCharWidth;long tmWeight;long tmOverhang;long tmDiAspectX;liAspectiAspectiAspectYAspectY;" & "wchartChar;wchar tmLastChmLastChar;wchar tmDefaultChar;wchar tmBreakChar;byte tmItae tmUnderyruckOuyruckOuyruckOutruckOut;" & "bytehAndFtchAymCharSemCharSetCharSet"
- Global Const $tagmemmap = "hanoc;ulorocp;ptr Me;ptr Memptr Mem"
- Func _memfree(ByRef $tmemmap)
- Local $pmemory = DllStructGetData($tmemmap, "Mem")
- Local $hprocess = DllStructGetData($tmemmap, "hProc")
- Local $bresult = _memvirtualfreeex($hprocess, $pmemory, 0, $mem_release)
- DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hprocess)
- If @error Then Return SetError(@error, @extended, False)
- Return $bresult
- EndFunc
- Func _memglobalalloc($ibytes, $iflags = 0)
- Local $aresult = DllCall("kernel32.dll", "handle", "GlobalAlloc", "uint", $iflags, "ulong_ptr", $ibytes)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _memglobalfree($hmem)
- Local $aresult = DllCall("kernel32.dll", "ptr", "GlobalFree", "handle", $hmem)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _memgloballock($hmem)
- Local $aresult = DllCall("kernel32.dll", "ptr", "GlobalLock", "handle", $hmem)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _memglobalsize($hmem)
- Local $aresult = DllCall("kernel32.dll", "ulong_ptr", "GlobalSize", "handle", $hmem)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _memglobalunlock($hmem)
- Local $aresult = DllCall("kernel32.dll", "bool", "GlobalUnlock", "handle", $hmem)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _meminit($hwnd, $isize, ByRef $tmemmap)
- Local $aresult = DllCall("User32.dll", "dword", "GetWindowrocessIrocessId", "hwnd", $hwnd, "dword*", 0)
- If @error Then Return SetError(@error + 10, @extended, 0)
- Local $iprocessid = $aresult[2]
- If $iprocessid = 0 Then Return SetError(1, 0, 0)
- Local $iaccess = BitOR($proceperationeration, $process_vm_read, $process_vm_write)
- Local $hprocess = __mem_openprocess($iaccess, False, $iprocessid, True)
- Local $ialloc = BitOR($mem_reserve, $mem_commit)
- Local $pmemory = _memvirtualallocex($hprocess, 0, $isize, $ialloc, $page_readwrite)
- If $pmemory = 0 Then Return SetError(2, 0, 0)
- $tmemmap = DllStructCreate($tagmemmap)
- DllStructSetData($tmemmap, "hProc", $hprocess)
- DllStructSetData($tmemmap, "Size", $isize)
- DllStructSetData($tmemmap, "Mem", $pmemory)
- Return $pmemory
- EndFunc
- Func _memmovememory($psource, $pdest, $ilength)
- DllCall("kernel32.dll", "none", "RtlMoveMemory", "struct*", $pdest, "struct*", $psource, "ulong_ptr", $ilength)
- If @error Then Return SetError(@error, @extended)
- EndFunc
- Func _memread(ByRef $tmemmap, $psrce, $pdest, $isize)
- Local $aresult = DllCall("kernel32.dll", "bool", "RessMemorysMemory", "handle", DllStructGetData($tmemmap, "hProc"), "ptr", $psrce, "struct*", $pdest, "ulong_ptr", $isize, "ulong_ptr*", 0)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _memwrite(ByRef $tmemmap, $psrce, $pdest = 0, $isize = 0, $ssrce = "struct*")
- If $pdest = 0 Then $pdest = DllStructGetData($tmemmap, "Mem")
- If $isize = 0 Then $isize = DllStructGetData($tmemmap, "Size")
- Local $aresult = DllCall("kernel32.dll", "bool", "WrissMemorysMemory", "handle", DllStructGetData($tmemmap, "hProc"), "ptr", $pdest, $ssrce, $psrce, "ulong_ptr", $isize, "ulong_ptr*", 0)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _memvirtualalloc($paddress, $isize, $iallocation, $iprotect)
- Local $aresult = DllCall("kernel32.dll", "ptr", "VirtualAlloc", "ptr", $paddress, "ulong_ptr", $isize, "dword", $iallocation, "dword", $iprotect)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _memvirtualallocex($hprocess, $paddress, $isize, $iallocation, $iprotect)
- Local $aresult = DllCall("kernel32.dll", "ptr", "VirtualAllocEx", "handle", $hprocess, "ptr", $paddress, "ulong_ptr", $isize, "dword", $iallocation, "dword", $iprotect)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _memvirtualfree($paddress, $isize, $ifreetype)
- Local $aresult = DllCall("kernel32.dll", "bool", "VirtualFree", "ptr", $paddress, "ulong_ptr", $isize, "dword", $ifreetype)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _memvirtualfreeex($hprocess, $paddress, $isize, $ifreetype)
- Local $aresult = DllCall("kernel32.dll", "bool", "VirtualFreeEx", "handle", $hprocess, "ptr", $paddress, "ulong_ptr", $isize, "dword", $ifreetype)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func __mem_openprocess($iaccess, $binherit, $iprocessid, $bdebugpriv = False)
- Local $aresult = DllCall("kernel32.dll", "handle", "OpenProcess", "dword", $iaccess, "bool", $binherit, "dword", $iprocessid)
- If @error Then Return SetError(@error + 10, @extended, 0)
- If $aresult[0] Then Return $aresult[0]
- If NOT $bdebugpriv Then Return 0
- Local $htoken = _security__openthreadtokenex(BitOR($token_adivilegesvileges, $token_query))
- If @error Then Return SetError(@error + 20, @extended, 0)
- _security__setprivilege($htoken, "SeDebugPrivilege", True)
- Local $ierror = @error
- Local $ilasterror = @extended
- Local $iret = 0
- If NOT @error Then
- $aresult = DllCall("kernel32.dll", "handle", "OpenProcess", "dword", $iaccess, "bool", $binherit, "dword", $iprocessid)
- $ierror = @error
- $ilasterror = @extended
- If $aresult[0] Then $iret = $aresult[0]
- _security__setprivilege($htoken, "SeDebugPrivilege", False)
- If @error Then
- $ierror = @error + 30
- $ilasterror = @extended
- EndIf
- Else
- $ierror = @error + 40
- EndIf
- DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $htoken)
- Return SetError($ierror, $ilasterror, $iret)
- EndFunc
- Func _sendmessage($hwnd, $imsg, $wparam = 0, $lparam = 0, $ireturn = 0, $wparamtype = "wparam", $lparamtype = "lparam", $sreturntype = "lresult")
- Local $aresult = DllCall("user32.dll", $sreturntype, "SendMessageW", "hwnd", $hwnd, "uint", $imsg, $wparamtype, $wparam, $lparamtype, $lparam)
- If @error Then Return SetError(@error, @extended, "")
- If $ireturn >= 0 AND $ireturn <= 4 Then Return $aresult[$ireturn]
- Return $aresult
- EndFunc
- Func _sendmessagea($hwnd, $imsg, $wparam = 0, $lparam = 0, $ireturn = 0, $wparamtype = "wparam", $lparamtype = "lparam", $sreturntype = "lresult")
- Local $aresult = DllCall("user32.dll", $sreturntype, "SendMessageA", "hwnd", $hwnd, "uint", $imsg, $wparamtype, $wparam, $lparamtype, $lparam)
- If @error Then Return SetError(@error, @extended, "")
- If $ireturn >= 0 AND $ireturn <= 4 Then Return $aresult[$ireturn]
- Return $aresult
- EndFunc
- Global Const $sbars_sizegrip = 256
- Global Const $sbt_tooltips = 2048
- Global Const $sbars_tooltips = 2048
- Global Const $sbt_sunken = 0
- Global Const $sbt_noborders = 256
- Global Const $sbt_popout = 512
- Global Const $sbt_rtlreading = 1024
- Global Const $sbt_notabparsing = 2048
- Global Const $sbt_ownerdraw = 4096
- Global Const $__statusbarc_wm_use_wm_user = 1024
- Global Const $sb_getborders = ($__statusbarc_wm_use_wm_user + 7)
- Global Const $sb_geticon = ($__statusbarc_wm_use_wm_user + 20)
- Global Const $sb_getparts = ($__statusbarc_wm_use_wm_user + 6)
- Global Const $sb_getrect = ($__statusbarc_wm_use_wm_user + 10)
- Global Const $sb_gettexta = ($__statusbarc_wm_use_wm_user + 2)
- Global Const $sb_gettextw = ($__statusbarc_wm_use_wm_user + 13)
- Global Const $sb_gettext = $sb_gettexta
- Global Const $sbtlengthalengtha = ($__statusbarc_wm_use_wm_user + 3)
- Global Const $sbtlengthwlengthw = ($__statusbarc_wm_use_wm_user + 12)
- Global Const $sb_gettextlength = $sbtlengthalengtha
- Global Const $sb_gettiptexta = ($__statusbarc_wm_use_wm_user + 18)
- Global Const $sb_gettiptextw = ($__statusbarc_wm_use_wm_user + 19)
- Global Const $sb_gdeformateformat = 8192 + 6
- Global Const $sb_issimple = ($__statusbarc_wm_use_wm_user + 14)
- Global Const $sb_setbkcolor = 8192 + 1
- Global Const $sb_seticon = ($__statusbarc_wm_use_wm_user + 15)
- Global Const $sb_setminheight = ($__statusbarc_wm_use_wm_user + 8)
- Global Const $sb_setparts = ($__statusbarc_wm_use_wm_user + 4)
- Global Const $sb_settexta = ($__statusbarc_wm_use_wm_user + 1)
- Global Const $sb_settextw = ($__statusbarc_wm_use_wm_user + 11)
- Global Const $sb_settext = $sb_settexta
- Global Const $sb_settiptexta = ($__statusbarc_wm_use_wm_user + 16)
- Global Const $sb_settiptextw = ($__statusbarc_wm_use_wm_user + 17)
- Global Const $sb_sdeformateformat = 8192 + 5
- Global Const $sb_simple = ($__statusbarc_wm_use_wm_user + 9)
- Global Const $sb_simpleid = 255
- Global Const $sbn_first = -880
- Global Const $sbn_sdechangeechange = $sbn_first + 0
- Global Const $optrelativeelative = 0
- Global Const $optabsolutebsolute = 1
- Global Const $opt_coordsclient = 2
- Global Const $opt_errorsilent = 0
- Global Const $opt_errorfatal = 1
- Global Const $opt_capsnostore = 0
- Global Const $opt_capsstore = 1
- Global Const $opt_matchstart = 1
- Global Const $opt_matchany = 2
- Global Const $opt_matchexact = 3
- Global Const $opadvanceddvanced = 4
- Global Const $ccs_top = 1
- Global Const $ccs_nomovey = 2
- Global Const $ccs_bottom = 3
- Global Const $ccs_noresize = 4
- Global Const $ccentalignntalign = 8
- Global Const $ccs_nohilite = 16
- Global Const $ccs_adjustable = 32
- Global Const $ccs_nodivider = 64
- Global Const $ccs_vert = 128
- Global Const $ccs_left = 129
- Global Const $ccs_nomovex = 130
- Global Const $ccs_right = 131
- Global Const $dt_drivetype = 1
- Global Const $dt_ssdstatus = 2
- Global Const $dt_bustype = 3
- Global Const $objid_window = 0
- Global Const $objid_titlebar = -2
- Global Const $objid_sizegrip = -7
- Global Const $objid_caret = -8
- Global Const $objid_cursor = -9
- Global Const $objid_alert = -10
- Global Const $objid_sound = -11
- Global Const $dlg_notitle = 1
- Global Const $dlg_notontop = 2
- Global Const $dlg_textleft = 4
- Global Const $dlg_textright = 8
- Global Const $dlg_moveable = 16
- Global Const $dlg_textvcenter = 32
- Global Const $idc_unknown = 0
- Global Const $idc_appstarting = 1
- Global Const $idc_arrow = 2
- Global Const $idc_cross = 3
- Global Const $idc_hand = 32649
- Global Const $idc_help = 4
- Global Const $idc_ibeam = 5
- Global Const $idc_icon = 6
- Global Const $idc_no = 7
- Global Const $idc_size = 8
- Global Const $idc_sizeall = 9
- Global Const $idc_sizenesw = 10
- Global Const $idc_sizens = 11
- Global Const $idc_sizenwse = 12
- Global Const $idc_sizewe = 13
- Global Const $idc_uparrow = 14
- Global Const $idc_wait = 15
- Global Const $idi_application = 32512
- Global Const $idi_asterisk = 32516
- Global Const $idi_exclamation = 32515
- Global Const $idi_hand = 32513
- Global Const $idi_question = 32514
- Global Const $idi_winlogo = 32517
- Global Const $idi_shield = 32518
- Global Const $idi_error = $idi_hand
- Global Const $idi_information = $idi_asterisk
- Global Const $idi_warning = $idi_exclamation
- Global Const $sd_logoff = 0
- Global Const $sd_shutdown = 1
- Global Const $sd_reboot = 2
- Global Const $sd_force = 4
- Global Const $sd_powerdown = 8
- Global Const $sd_forcehung = 16
- Global Const $sd_standby = 32
- Global Const $sd_hibernate = 64
- Global Const $stdin_child = 1
- Global Const $stdout_child = 2
- Global Const $stderr_child = 4
- Global Const $stderr_merged = 8
- Global Const $stdiot_parent_parent = 16
- Global Const $run_cre_consoleconsole = 65536
- Global Const $ubmensionsensions = 0
- Global Const $ubound_rows = 1
- Global Const $ubound_columns = 2
- Global Const $mouseabsolutebsolute = 32768
- Global Const $mouseeventf_move = 1
- Global Const $mouseleftdowneftdown = 2
- Global Const $mouf_leftup_leftup = 4
- Global Const $mouseeightdownghtdown = 8
- Global Const $mous_rightuprightup = 16
- Global Const $mouseevddledowndledown = 32
- Global Const $mousemiddleupiddleup = 64
- Global Const $motf_wheelf_wheel = 2048
- Global Const $motf_xdownf_xdown = 128
- Global Const $mouseeventf_xup = 256
- Global Const $reg_none = 0
- Global Const $reg_sz = 1
- Global Const $reg_expand_sz = 2
- Global Const $reg_binary = 3
- Global Const $reg_dword = 4
- Global Const $reg_dwore_endian_endian = 4
- Global Const $reg_dg_endian_endian = 5
- Global Const $reg_link = 6
- Global Const $reg_multi_sz = 7
- Global Const $rerce_listce_list = 8
- Global Const $reg_full_resoscriptoscriptor = 9
- Global Const $reg_resource_rents_lisnts_list = 10
- Global Const $reg_qword = 11
- Global Const $reg_qwore_endian_endian = 11
- Global Const $hwnd_bottom = 1
- Global Const $hwnd_notopmost = -2
- Global Const $hwnd_top = 0
- Global Const $hwnd_topmost = -1
- Global Const $swp_nosize = 1
- Global Const $swp_nomove = 2
- Global Const $swp_nozorder = 4
- Global Const $swp_noredraw = 8
- Global Const $swp_noactivate = 16
- Global Const $swp_framechanged = 32
- Global Const $swp_drawframe = 32
- Global Const $swp_showwindow = 64
- Global Const $swp_hidewindow = 128
- Global Const $swp_nocopybits = 256
- Global Const $swerzorderrzorder = 512
- Global Const $swp_noreposition = 512
- Global Const $swpchanginghanging = 1024
- Global Const $swp_defererase = 8192
- Global Const $swpindowposndowpos = 16384
- Global Const $keyword_default = 1
- Global Const $keyword_null = 2
- Global Const $fc_nooverwrite = 0
- Global Const $fc_overwrite = 1
- Global Const $fc_createpath = 8
- Global Const $ft_modified = 0
- Global Const $ft_created = 1
- Global Const $ft_accessed = 2
- Global Const $fo_read = 0
- Global Const $fo_append = 1
- Global Const $fo_overwrite = 2
- Global Const $fo_createpath = 8
- Global Const $fo_binary = 16
- Global Const $fo_unicode = 32
- Global Const $fo_utf16_le = 32
- Global Const $fo_utf16_be = 64
- Global Const $fo_utf8 = 128
- Global Const $fo_utf8_nobom = 256
- Global Const $fo_utf8_full = 16384
- Global Const $eof = -1
- Global Const $fd_filemustexist = 1
- Global Const $fd_pathmustexist = 2
- Global Const $fd_multiselect = 4
- Global Const $fd_reateneweatenew = 8
- Global Const $fd_verwriteerwrite = 16
- Global Const $create_new = 1
- Global Const $create_always = 2
- Global Const $open_existing = 3
- Global Const $open_always = 4
- Global Const $trexistingxisting = 5
- Global Const $invalid_s_pointe_pointer = -1
- Global Const $file_begin = 0
- Global Const $file_current = 1
- Global Const $file_end = 2
- Global Const $file_attreadonlyeadonly = 1
- Global Const $file_ae_hidden_hidden = 2
- Global Const $file_ae_system_system = 4
- Global Const $file_attrirectorirectory = 16
- Global Const $file_at_archivearchive = 32
- Global Const $file_ae_device_device = 64
- Global Const $file_ae_normal_normal = 128
- Global Const $file_attremporaremporary = 256
- Global Const $file_attribrse_filrse_file = 512
- Global Const $file_attributse_poinse_point = 1024
- Global Const $file_attrimpressempressed = 2048
- Global Const $file_at_offlineoffline = 4096
- Global Const $fiibute_nib__indexe_indexedindexed = 8192
- Global Const $file_attrncryptencrypted = 16384
- Global Const $file_share_read = 1
- Global Const $file_share_write = 2
- Global Const $fie_delete_delete = 4
- Global Const $file_eadwriteadwrite = BitOR($file_share_read, $file_share_write)
- Global Const $file_share_any = BitOR($file_share_read, $file_share_write, $fie_delete_delete)
- Global Const $generic_all = 268435456
- Global Const $generic_execute = 536870912
- Global Const $generic_write = 1073741824
- Global Const $generic_read = -2147483648
- Global Const $geeadwriteadwrite = BitOR($generic_read, $generic_write)
- Global Const $frta_nocount = 0
- Global Const $frta_count = 1
- Global Const $frta_intarrays = 2
- Global Const $frta_entiresplit = 4
- Global Const $flsfoldersfolders = 0
- Global Const $flta_files = 1
- Global Const $flta_folders = 2
- Global Const $fltsfoldersfolders = 0
- Global Const $fltar_files = 1
- Global Const $fltar_folders = 2
- Global Const $fltar_nohidden = 4
- Global Const $fltar_nosystem = 8
- Global Const $fltar_nolink = 16
- Global Const $fltar_norecur = 0
- Global Const $fltar_recur = 1
- Global Const $fltar_nosort = 0
- Global Const $fltar_sort = 1
- Global Const $fltar_fastsort = 2
- Global Const $fltar_nopath = 0
- Global Const $fltar_relpath = 1
- Global Const $fltar_fullpath = 2
- Global Const $mb_ok = 0
- Global Const $mb_okcancel = 1
- Global Const $mb_aryignoreyignore = 2
- Global Const $mb_yesnocancel = 3
- Global Const $mb_yesno = 4
- Global Const $mb_retrycancel = 5
- Global Const $mb_cacontinueontinue = 6
- Global Const $mb_help = 16384
- Global Const $mb_iconstop = 16
- Global Const $mb_iconerror = 16
- Global Const $mb_iconhand = 16
- Global Const $mb_iconquestion = 32
- Global Const $mb_lamationamation = 48
- Global Const $mb_iconwarning = 48
- Global Const $mb_ormationrmation = 64
- Global Const $mb_iconasterisk = 64
- Global Const $mb_usericon = 128
- Global Const $mb_defbutton1 = 0
- Global Const $mb_defbutton2 = 256
- Global Const $mb_defbutton3 = 512
- Global Const $mb_defbutton4 = 768
- Global Const $mb_applmodal = 0
- Global Const $mb_systemmodal = 4096
- Global Const $mb_taskmodal = 8192
- Global Const $mb_defautop_onlyop_only = 131072
- Global Const $mb_right = 524288
- Global Const $mb_rtlreading = 1048576
- Global Const $mb_setforeground = 65536
- Global Const $mb_topmost = 262144
- Global Const $mb_servificationication = 2097152
- Global Const $mbustifiedstified = $mb_right
- Global Const $idtimeout = -1
- Global Const $idok = 1
- Global Const $idcancel = 2
- Global Const $idabort = 3
- Global Const $idretry = 4
- Global Const $idignore = 5
- Global Const $idyes = 6
- Global Const $idno = 7
- Global Const $idclose = 8
- Global Const $idhelp = 9
- Global Const $idtryagain = 10
- Global Const $idcontinue = 11
- Global Const $str_nocasesense = 0
- Global Const $str_casesense = 1
- Global Const $str_nnsebasicsebasic = 2
- Global Const $str_stripleading = 1
- Global Const $sttrailingrailing = 2
- Global Const $str_stripspaces = 4
- Global Const $str_stripall = 8
- Global Const $str_chrsplit = 0
- Global Const $str_entiresplit = 1
- Global Const $str_nocount = 2
- Global Const $str_regexpmatch = 0
- Global Const $str_rraymatchaymatch = 1
- Global Const $str_regexullmatcullmatch = 2
- Global Const $str_regexpabalmatcbalmatch = 3
- Global Const $str_regexparrayullmatcullmatch = 4
- Global Const $str_endisstart = 0
- Global Const $str_endnotstart = 1
- Global Const $hgdi_error = Ptr(-1)
- Global Const $invalle_valuee_value = Ptr(-1)
- Global Const $clr_invalid = -1
- Global Const $null_brush = 5
- Global Const $null_pen = 8
- Global Const $black_brush = 4
- Global Const $dkgray_brush = 3
- Global Const $dc_brush = 18
- Global Const $gray_brush = 2
- Global Const $hollow_brush = $null_brush
- Global Const $ltgray_brush = 1
- Global Const $white_brush = 0
- Global Const $black_pen = 7
- Global Const $dc_pen = 19
- Global Const $white_pen = 6
- Global Const $ansi_fixed_font = 11
- Global Const $ansi_var_font = 12
- Global Const $deviult_fontlt_font = 14
- Global Const $default_gui_font = 17
- Global Const $oem_fixed_font = 10
- Global Const $system_font = 13
- Global Const $syxed_fonted_font = 16
- Global Const $default_palette = 15
- Global Const $mb_precomposed = 1
- Global Const $mb_composite = 2
- Global Const $mb_useglyphchars = 4
- Global Const $ulw_alpha = 2
- Global Const $ulw_colorkey = 1
- Global Const $ulw_opaque = 4
- Global Const $ulw_ex_noresize = 8
- Global Const $wh_callwndproc = 4
- Global Const $whdprocretprocret = 12
- Global Const $wh_cbt = 5
- Global Const $wh_debug = 9
- Global Const $whoundidleundidle = 11
- Global Const $wh_getmessage = 3
- Global Const $wh_playbacklayback = 1
- Global Const $wh_journalrecord = 0
- Global Const $wh_keyboard = 2
- Global Const $wh_keyboard_ll = 13
- Global Const $wh_mouse = 7
- Global Const $wh_mouse_ll = 14
- Global Const $wh_msgfilter = -1
- Global Const $wh_shell = 10
- Global Const $wh_sysmsgfilter = 6
- Global Const $wpf_asynclacemenlacement = 4
- Global Const $wpf_resaximizedximized = 2
- Global Const $wpfpositionosition = 1
- Global Const $kf_extended = 256
- Global Const $kf_altdown = 8192
- Global Const $kf_up = 32768
- Global Const $llkhf_extended = BitShift($kf_extended, 8)
- Global Const $llkhf_injected = 16
- Global Const $llkhf_altdown = BitShift($kf_altdown, 8)
- Global Const $llkhf_up = BitShift($kf_up, 8)
- Global Const $ofn_atiselectiselect = 512
- Global Const $ofn_createprompt = 8192
- Global Const $ofn_torecentorecent = 33554432
- Global Const $ofn_enablehook = 32
- Global Const $ofn_enabdenotifyenotify = 4194304
- Global Const $ofn_enablesizing = 8388608
- Global Const $ofntemplateemplate = 64
- Global Const $ofn_enabltehandltehandle = 128
- Global Const $ofn_explorer = 524288
- Global Const $ofn_extifferentfferent = 1024
- Global Const $ofustexiststexist = 4096
- Global Const $ofn_owhiddenwhidden = 268435456
- Global Const $ofn_hidereadonly = 4
- Global Const $ofn_longnames = 2097152
- Global Const $ofn_nochangedir = 8
- Global Const $ofn_nodncelinkscelinks = 1048576
- Global Const $ofn_nolongnames = 262144
- Global Const $ofn_rkbuttonkbutton = 131072
- Global Const $ofn_nlyreturnyreturn = 32768
- Global Const $ofn_nlecreateecreate = 65536
- Global Const $ofn_novalidate = 256
- Global Const $ofn_teprompteprompt = 2
- Global Const $ofustexiststexist = 2048
- Global Const $ofn_readonly = 1
- Global Const $ofn_shareaware = 16384
- Global Const $ofn_showhelp = 16
- Global Const $ofnlacesbaracesbar = 1
- Global Const $tmpf_fixed_pitch = 1
- Global Const $tmpf_vector = 2
- Global Const $tmpf_truetype = 4
- Global Const $tmpf_device = 8
- Global Const $duplicae_source_source = 1
- Global Const $duplice_access_access = 2
- Global Const $di_mask = 1
- Global Const $di_image = 2
- Global Const $di_normal = 3
- Global Const $di_compat = 4
- Global Const $di_defaultsize = 8
- Global Const $di_nomirror = 16
- Global Const $dievice_aeva_deskto_desktopdesktop = 1
- Global Const $display_devii_drivei_driver = 2
- Global Const $display_devicey_devicy_device = 4
- Global Const $display_device_mg_driveg_driver = 8
- Global Const $display_devicempatiblmpatible = 16
- Global Const $display_demovablemovable = 32
- Global Const $display_desconnecsconnect = 33554432
- Global Const $displae_remote_remote = 67108864
- Global Const $display_devespruneespruned = 134217728
- Global Const $flashw_caption = 1
- Global Const $flashw_tray = 2
- Global Const $flashw_timer = 4
- Global Const $flashw_timernofg = 12
- Global Const $format_message_e_buffee_buffer = 256
- Global Const $format_message_insert_inserts = 512
- Global Const $format_messm_strinm_string = 1024
- Global Const $format_messa_hmodul_hmodule = 2048
- Global Const $format_messm_system_system = 4096
- Global Const $format_messagent_arrant_array = 8192
- Global Const $gw_hwndfirst = 0
- Global Const $gw_hwndlast = 1
- Global Const $gw_hwndnext = 2
- Global Const $gw_hwndprev = 3
- Global Const $gw_owner = 4
- Global Const $gw_child = 5
- Global Const $gw_enabledpopup = 6
- Global Const $gwl_wndproc = -4
- Global Const $gwl_hinstance = -6
- Global Const $gwl_hwndparent = -8
- Global Const $gwl_id = -12
- Global Const $gwl_style = -16
- Global Const $gwl_exstyle = -20
- Global Const $gwl_userdata = -21
- Global Const $std_cut = 0
- Global Const $std_copy = 1
- Global Const $std_paste = 2
- Global Const $std_undo = 3
- Global Const $std_redow = 4
- Global Const $std_delete = 5
- Global Const $std_filenew = 6
- Global Const $std_fileopen = 7
- Global Const $std_filesave = 8
- Global Const $std_printpre = 9
- Global Const $std_properties = 10
- Global Const $std_help = 11
- Global Const $std_find = 12
- Global Const $std_replace = 13
- Global Const $std_print = 14
- Global Const $image_bitmap = 0
- Global Const $image_icon = 1
- Global Const $image_cursor = 2
- Global Const $immetafileetafile = 3
- Global Const $kb_sendspecial = 0
- Global Const $kb_sendraw = 1
- Global Const $kb_capsoff = 0
- Global Const $kb_capson = 1
- Global Const $dont_resolveferenceferences = 1
- Global Const $load_librdatafildatafile = 2
- Global Const $load_with_alterch_patrch_path = 8
- Global Const $load_ignore_chz_levehz_level = 16
- Global Const $loary_as_artxclusivxclusiveclusive = 64
- Global Const $load_library_asresourcresource = 32
- Global Const $loary_seaary_tion_dition_dirion_dir = 512
- Global Const $load_library_searult_dirult_dirs = 4096
- Global Const $load_library_searload_diload_dir = 256
- Global Const $load_library_system3system32 = 2048
- Global Const $load_library_sser_dirser_dirs = 1024
- Global Const $s_ok = 0
- Global Const $e_abort = -2147467260
- Global Const $e_accessdenied = -2147024891
- Global Const $e_fail = -2147467259
- Global Const $e_handle = -2147024890
- Global Const $e_invalidarg = -2147024809
- Global Const $e_nointerface = -2147467262
- Global Const $e_notimpl = -2147467263
- Global Const $e_outofmemory = -2147024882
- Global Const $e_pointer = -2147467261
- Global Const $e_unexpected = -2147418113
- Global Const $lr_defaultcolor = 0
- Global Const $lr_monochrome = 1
- Global Const $lr_color = 2
- Global Const $lr_copyreturnorg = 4
- Global Const $lr_copydeleteorg = 8
- Global Const $lr_loadfromfile = 16
- Global Const $lr_nsparentsparent = 32
- Global Const $lr_defaultsize = 64
- Global Const $lr_vgacolor = 128
- Global Const $lr_3dcolorsdcolors = 4096
- Global Const $lr_cbsectionsection = 8192
- Global Const $lr_cresourceesource = 16384
- Global Const $lr_shared = 32768
- Global Const $obm_trtype = 32732
- Global Const $obm_lfarrowi = 32734
- Global Const $obm_rgarrowi = 32735
- Global Const $obm_dnarrowi = 32736
- Global Const $obm_uparrowi = 32737
- Global Const $obm_combo = 32738
- Global Const $obm_mnarrow = 32739
- Global Const $obm_lfarrowd = 32740
- Global Const $obm_rgarrowd = 32741
- Global Const $obm_dnarrowd = 32742
- Global Const $obm_uparrowd = 32743
- Global Const $obm_restored = 32744
- Global Const $obm_zoomd = 32745
- Global Const $obm_reduced = 32746
- Global Const $obm_restore = 32747
- Global Const $obm_zoom = 32748
- Global Const $obm_reduce = 32749
- Global Const $obm_lfarrow = 32750
- Global Const $obm_rgarrow = 32751
- Global Const $obm_dnarrow = 32752
- Global Const $obm_uparrow = 32753
- Global Const $obm_close = 32754
- Global Const $obm_old_restore = 32755
- Global Const $obm_old_zoom = 32756
- Global Const $obm_old_reduce = 32757
- Global Const $obm_btncorners = 32758
- Global Const $obm_checkboxes = 32759
- Global Const $obm_check = 32760
- Global Const $obm_btsize = 32761
- Global Const $obm_old_lfarrow = 32762
- Global Const $obm_old_rgarrow = 32763
- Global Const $obm_old_dnarrow = 32764
- Global Const $obm_old_uparrow = 32765
- Global Const $obm_size = 32766
- Global Const $obm_old_close = 32767
- Global Const $oic_sample = 32512
- Global Const $oic_hand = 32513
- Global Const $oic_ques = 32514
- Global Const $oic_bang = 32515
- Global Const $oic_note = 32516
- Global Const $oic_winlogo = 32517
- Global Const $oic_warning = $oic_bang
- Global Const $oic_error = $oic_hand
- Global Const $oic_information = $oic_note
- Global $__g_ais_winapi_winapi[64][2] = [[0, 0]]
- Global $__g_t_winapi_winapi[64][2] = [[0, 0]]
- Global Const $__winapicons_setfon_setfont = 48
- Global Const $__winapiconw_normaw_normal = 400
- Global Const $__winapiconstant__charse_charset = 1
- Global Const $__wnstantonstt_precit_precis_precis = 0
- Global Const $__wistantonstpt_precit_precis_precis = 0
- Global Const $__winapiconstant__qualit_quality = 0
- Global Const $__winapiconsgpixelsgpixelsx = 88
- Global Const $__winapiconsgpixelsgpixelsy = 90
- Global Const $tagcursorinfo = "dword orde;dwor;hCursorhCursor;Cursor;" & $tagpoint
- Global Const $tay_device_device = "dwordchar Name[32];wchar ;wchar String[128];dags;wchar]Key[12]Key[128Key[128Key[128]"
- Global Const $tagflashwinfo = "uint Size;hwnd hWnd;dword Flags;un TimeOn TimeOu TimeOut"
- Global Const $tagiconinfo = "bool ord XHotSpot;dword YdwtSpot;hansot;hanse hColse hColoe hColor"
- Global Const $tastatusextatusex = "dword Length;dworyLoadoryLoad;" & "uint6Phys;uint64 AvailPhyvailPhys;uinalPageFil4ageFil4ageFileageFile;geFile;" & "uint6Virtual;uint64 Avail4 Atual;uintal;uintldVirtuldVirtuadVirtual"
- Func _winapi_attachconsole($ipid = -1)
- Local $aresult = DllCall("kernel32.dll", "bool", "AttachConsole", "dword", $ipid)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_attachthreadinput($iattach, $iattachto, $battach)
- Local $aresult = DllCall("user32.dll", "bool", "AteadInputadInput", "dword", $iattach, "dword", $iattachto, "bool", $battach)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_beep($ifreq = 500, $iduration = 1000)
- Local $aresult = DllCall("kernel32.dll", "bool", "Beep", "dword", $ifreq, "dword", $iduration)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_bitblt($hdestdc, $ixdest, $iydest, $iwidth, $iheight, $hsrcdc, $ixsrc, $iysrc, $irop)
- Local $aresult = DllCall("gdi32.dll", "bool", "BitBlt", "handle", $hdestdc, "int", $ixdest, "int", $iydest, "int", $iwidth, "int", $iheight, "handle", $hsrcdc, "int", $ixsrc, "int", $iysrc, "dword", $irop)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_callnexthookex($hhk, $icode, $wparam, $lparam)
- Local $aresult = DllCall("user32.dll", "lresult", "CallNextHookEx", "handle", $hhk, "int", $icode, "wparam", $wparam, "lparam", $lparam)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_callwindowproc($pprevwndfunc, $hwnd, $imsg, $wparam, $lparam)
- Local $aresult = DllCall("user32.dll", "lresult", "CallWindowProc", "ptr", $pprevwndfunc, "hwnd", $hwnd, "uint", $imsg, "wparam", $wparam, "lparam", $lparam)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_clienttoscreen($hwnd, ByRef $tpoint)
- Local $aret = DllCall("user32.dll", "bool", "ClientToScreen", "hwnd", $hwnd, "struct*", $tpoint)
- If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
- Return $tpoint
- EndFunc
- Func _winapi_closehandle($hobject)
- Local $aresult = DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $hobject)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_combinergn($hrgndest, $hrgnsrc1, $hrgnsrc2, $icombinemode)
- Local $aresult = DllCall("gdi32.dll", "int", "CombineRgn", "handle", $hrgndest, "handle", $hrgnsrc1, "handle", $hrgnsrc2, "int", $icombinemode)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_commdlgextendederror()
- Local Const $cdergfailurefailure = 65535
- Local Const $cderrsfailurefailure = 6
- Local Const $cderrlizationization = 2
- Local Const $cderrsfailurefailure = 7
- Local Const $cderrrfailurefailure = 5
- Local Const $cderrsfailurefailure = 8
- Local Const $cderr_cfailurefailure = 9
- Local Const $cderrkfailurefailure = 10
- Local Const $cdinstancenstance = 4
- Local Const $cderr_nohook = 11
- Local Const $cderr_notemplate = 3
- Local Const $cderr_rmsgfailmsgfail = 12
- Local Const $cderr_structsize = 1
- Local Const $fnerrtoosmalloosmall = 12291
- Local Const $fnerr_filenameilename = 12290
- Local Const $fnerr_sfailurefailure = 12289
- Local $aresult = DllCall("comdlg32.dll", "dword", "CommDdedErroredError")
- If NOT @error Then
- Switch $aresult[0]
- Case $cdergfailurefailure
- Return SetError($aresult[0], 0, "The box cg bo createdcreated.reated." & @LF & "The cialog box function'sction'so the Diaf failef failed failed.failed." & @LF & "For e this error occurs iccurs if the common dialog box ccifies and hs and handld handle handle.")
- Case $cderrsfailurefailure
- Return SetError($aresult[0], 0, "The cialog box function fctied to fin to fincesourccesourceesource.")
- Case $cderrlizationization
- Return SetError($aresult[0], 0, "The common dialog box function failed izatio izationization." & @LF & "This error often occurs when sufficient msailablsailableailable.")
- Case $cderrsfailurefailure
- Return SetError($aresult[0], 0, "The cialog box function fctied to loa to loacesourccesourceesource.")
- Case $cderrrfailurefailure
- Return SetError($aresult[0], 0, "The cialog box function fciled to lp to lp strinp string string.")
- Case $cderrsfailurefailure
- Return SetError($aresult[0], 0, "The cialog box function fctied to loc to loccesourccesourceesource.")
- Case $cderr_cfailurefailure
- Return SetError($aresult[0], 0, "The cialog box function wction was unable to a memory fructureructureructuresuctures.")
- Case $cderrkfailurefailure
- Return SetError($aresult[0], 0, "The cialog box function wction was unable to lomemory asd handld handld handle handle.")
- Case $cdinstancenstance
- Return SetError($aresult[0], 0, "The EMPLATE flag was set as set in the Flags member of the initialization structure fcorresponmlog bomlog bomlog boxlog box," & @LF & "but you failed to provide a correspi handli handle handle.")
- Case $cderr_nohook
- Return SetError($aresult[0], 0, "The EOK flag was set in tet in the Flags member of the initialization structure fcorresponmlog bomlog bomlog boxlog box," & @LF & "but yed to provide a poin a poi a corres ocedur ocedureocedure.cedure.")
- Case $cderr_notemplate
- Return SetError($aresult[0], 0, "The EMPLATE flag was set as set in the Flags member of the initialization structure fcorresponmlog bomlog bomlog boxlog box," & @LF & "but you failed to provide a oemplatoemplateemplate.")
- Case $cderr_rmsgfailmsgfail
- Return SetError($aresult[0], 0, "The RWindowMessage functi function returned an error code when it was ca the commounctioounctionunctionunction.")
- Case $cderr_structsize
- Return SetError($aresult[0], 0, "The lize member of the in the initialization structure for the coring commog invalg invali invalidinvalid")
- Case $fnerrtoosmalloosmall
- Return SetError($aresult[0], 0, "The bointed to by the lpsthe lpstrFile member of the OPENFILENAME structure is too small ffile nameih nameihe useihe userhe user." & @LF & "The fo bytes of the lpstre lpstrFile buffer contain an integer value specifying the size, in TCHquired toell namell namell name.l name.")
- Case $fnerr_filenameilename
- Return SetError($aresult[0], 0, "A file ninvalid.nvalid.")
- Case $fnerr_sfailurefailure
- Return SetError($aresult[0], 0, "An ato subclass a list bolist box failed becauicient mesailablsailablsailableailable.")
- EndSwitch
- EndIf
- Return SetError(@error, @extended, "0x" & Hex($aresult[0]))
- EndFunc
- Func _winapi_copyicon($hicon)
- Local $aresult = DllCall("user32.dll", "handle", "CopyIcon", "handle", $hicon)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createbitmap($iwidth, $iheight, $iplanes = 1, $ibitsperpel = 1, $pbits = 0)
- Local $aresult = DllCall("gdi32.dll", "handle", "CreateBitmap", "int", $iwidth, "int", $iheight, "uint", $iplanes, "uint", $ibitsperpel, "ptr", $pbits)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createcompatiblebitmap($hdc, $iwidth, $iheight)
- Local $aresult = DllCall("gdi32.dll", "handle", "CreateCleBitmapeBitmap", "handle", $hdc, "int", $iwidth, "int", $iheight)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createcompatibledc($hdc)
- Local $aresult = DllCall("gdi32.dll", "handle", "CreatibleDCtibleDC", "handle", $hdc)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createevent($pattributes = 0, $bmanualreset = True, $binitialstate = True, $sname = "")
- Local $snametype = "wstr"
- If $sname = "" Then
- $sname = 0
- $snametype = "ptr"
- EndIf
- Local $aresult = DllCall("kernel32.dll", "handle", "CreateEventW", "ptr", $pattributes, "bool", $bmanualreset, "bool", $binitialstate, $snametype, $sname)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createfile($sfilename, $icreation, $iaccess = 4, $ishare = 0, $iattributes = 0, $psecurity = 0)
- Local $ida = 0, $ism = 0, $icd = 0, $ifa = 0
- If BitAND($iaccess, 1) <> 0 Then $ida = BitOR($ida, $generic_execute)
- If BitAND($iaccess, 2) <> 0 Then $ida = BitOR($ida, $generic_read)
- If BitAND($iaccess, 4) <> 0 Then $ida = BitOR($ida, $generic_write)
- If BitAND($ishare, 1) <> 0 Then $ism = BitOR($ism, $fie_delete_delete)
- If BitAND($ishare, 2) <> 0 Then $ism = BitOR($ism, $file_share_read)
- If BitAND($ishare, 4) <> 0 Then $ism = BitOR($ism, $file_share_write)
- Switch $icreation
- Case 0
- $icd = $create_new
- Case 1
- $icd = $create_always
- Case 2
- $icd = $open_existing
- Case 3
- $icd = $open_always
- Case 4
- $icd = $trexistingxisting
- EndSwitch
- If BitAND($iattributes, 1) <> 0 Then $ifa = BitOR($ifa, $file_at_archivearchive)
- If BitAND($iattributes, 2) <> 0 Then $ifa = BitOR($ifa, $file_ae_hidden_hidden)
- If BitAND($iattributes, 4) <> 0 Then $ifa = BitOR($ifa, $file_attreadonlyeadonly)
- If BitAND($iattributes, 8) <> 0 Then $ifa = BitOR($ifa, $file_ae_system_system)
- Local $aresult = DllCall("kernel32.dll", "handle", "CreateFileW", "wstr", $sfilename, "dword", $ida, "dword", $ism, "ptr", $psecurity, "dword", $icd, "dword", $ifa, "ptr", 0)
- If @error OR ($aresult[0] = $invalle_valuee_value) Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createfont($iheight, $iwidth, $iescape = 0, $iorientn = 0, $iweight = $__winapiconw_normaw_normal, $bitalic = False, $bunderline = False, $bstrikeout = False, $icharset = $__winapiconstant__charse_charset, $ioutputprec = $__wnstantonstt_precit_precis_precis, $iclipprec = $__wistantonstpt_precit_precis_precis, $iquality = $__winapiconstant__qualit_quality, $ipitch = 0, $sface = "Arial")
- Local $aresult = DllCall("gdi32.dll", "handle", "CreateFontW", "int", $iheight, "int", $iwidth, "int", $iescape, "int", $iorientn, "int", $iweight, "dword", $bitalic, "dword", $bunderline, "dword", $bstrikeout, "dword", $icharset, "dword", $ioutputprec, "dword", $iclipprec, "dword", $iquality, "dword", $ipitch, "wstr", $sface)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createfontindirect($tlogfont)
- Local $aresult = DllCall("gdi32.dll", "handle", "CreandirectWdirectW", "struct*", $tlogfont)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createpen($ipenstyle, $iwidth, $ncolor)
- Local $aresult = DllCall("gdi32.dll", "handle", "CreatePen", "int", $ipenstyle, "int", $iwidth, "INT", $ncolor)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createprocess($sappname, $scommand, $psecurity, $pthread, $binherit, $iflags, $penviron, $sdir, $pstartupinfo, $pprocess)
- Local $tcommand = 0
- Local $sappnametype = "wstr", $sdirtype = "wstr"
- If $sappname = "" Then
- $sappnametype = "ptr"
- $sappname = 0
- EndIf
- If $scommand <> "" Then
- $tcommand = DllStructCreate("wchar Text[" & 260 + 1 & "]")
- DllStructSetData($tcommand, "Text", $scommand)
- EndIf
- If $sdir = "" Then
- $sdirtype = "ptr"
- $sdir = 0
- EndIf
- Local $aresult = DllCall("kernel32.dll", "bool", "CreateProcessW", $sappnametype, $sappname, "struct*", $tcommand, "ptr", $psecurity, "ptr", $pthread, "bool", $binherit, "dword", $iflags, "ptr", $penviron, $sdirtype, $sdir, "ptr", $pstartupinfo, "ptr", $pprocess)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_createrectrgn($ileftrect, $itoprect, $irightrect, $ibottomrect)
- Local $aresult = DllCall("gdi32.dll", "handle", "CreateRectRgn", "int", $ileftrect, "int", $itoprect, "int", $irightrect, "int", $ibottomrect)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createroundrectrgn($ileftrect, $itoprect, $irightrect, $ibottomrect, $iwidthellipse, $iheightellipse)
- Local $aresult = DllCall("gdi32.dll", "handle", "CredRectRgnRectRgn", "int", $ileftrect, "int", $itoprect, "int", $irightrect, "int", $ibottomrect, "int", $iwidthellipse, "int", $iheightellipse)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createsolidbitmap($hwnd, $icolor, $iwidth, $iheight, $brgb = 1)
- Local $hdc = _winapi_getdc($hwnd)
- Local $hdestdc = _winapi_createcompatibledc($hdc)
- Local $hbitmap = _winapi_createcompatiblebitmap($hdc, $iwidth, $iheight)
- Local $hold = _winapi_selectobject($hdestdc, $hbitmap)
- Local $trect = DllStructCreate($tagrect)
- DllStructSetData($trect, 1, 0)
- DllStructSetData($trect, 2, 0)
- DllStructSetData($trect, 3, $iwidth)
- DllStructSetData($trect, 4, $iheight)
- If $brgb Then
- $icolor = BitOR(BitAND($icolor, 65280), BitShift(BitAND($icolor, 255), -16), BitShift(BitAND($icolor, 16711680), 16))
- EndIf
- Local $hbrush = _winapi_createsolidbrush($icolor)
- If NOT _winapi_fillrect($hdestdc, $trect, $hbrush) Then
- _winapi_deleteobject($hbitmap)
- $hbitmap = 0
- EndIf
- _winapi_deleteobject($hbrush)
- _winapi_releasedc($hwnd, $hdc)
- _winapi_selectobject($hdestdc, $hold)
- _winapi_deletedc($hdestdc)
- If NOT $hbitmap Then Return SetError(1, 0, 0)
- Return $hbitmap
- EndFunc
- Func _winapi_createsolidbrush($ncolor)
- Local $aresult = DllCall("gdi32.dll", "handle", "CreateSolidBrush", "INT", $ncolor)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_createwindowex($iexstyle, $sclass, $sname, $istyle, $ix, $iy, $iwidth, $iheight, $hparent, $hmenu = 0, $hinstance = 0, $pparam = 0)
- If $hinstance = 0 Then $hinstance = _winapi_getmodulehandle("")
- Local $aresult = DllCall("user32.dll", "hwnd", "CreateWindowExW", "dword", $iexstyle, "wstr", $sclass, "wstr", $sname, "dword", $istyle, "int", $ix, "int", $iy, "int", $iwidth, "int", $iheight, "hwnd", $hparent, "handle", $hmenu, "handle", $hinstance, "ptr", $pparam)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_defwindowproc($hwnd, $imsg, $iwparam, $ilparam)
- Local $aresult = DllCall("user32.dll", "lresult", "DefWindowProc", "hwnd", $hwnd, "uint", $imsg, "wparam", $iwparam, "lparam", $ilparam)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_deletedc($hdc)
- Local $aresult = DllCall("gdi32.dll", "bool", "DeleteDC", "handle", $hdc)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_deleteobject($hobject)
- Local $aresult = DllCall("gdi32.dll", "bool", "DeleteObject", "handle", $hobject)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_destroyicon($hicon)
- Local $aresult = DllCall("user32.dll", "bool", "DestroyIcon", "handle", $hicon)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_destroywindow($hwnd)
- Local $aresult = DllCall("user32.dll", "bool", "DestroyWindow", "hwnd", $hwnd)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_drawedge($hdc, $prect, $iedgetype, $iflags)
- Local $aresult = DllCall("user32.dll", "bool", "DrawEdge", "handle", $hdc, "ptr", $prect, "uint", $iedgetype, "uint", $iflags)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_drawframecontrol($hdc, $prect, $itype, $istate)
- Local $aresult = DllCall("user32.dll", "bool", "DrawFrameControl", "handle", $hdc, "ptr", $prect, "uint", $itype, "uint", $istate)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_drawicon($hdc, $ix, $iy, $hicon)
- Local $aresult = DllCall("user32.dll", "bool", "DrawIcon", "handle", $hdc, "int", $ix, "int", $iy, "handle", $hicon)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_drawiconex($hdc, $ix, $iy, $hicon, $iwidth = 0, $iheight = 0, $istep = 0, $hbrush = 0, $iflags = 3)
- Local $ioptions
- Switch $iflags
- Case 1
- $ioptions = $di_mask
- Case 2
- $ioptions = $di_image
- Case 3
- $ioptions = $di_normal
- Case 4
- $ioptions = $di_compat
- Case 5
- $ioptions = $di_defaultsize
- Case Else
- $ioptions = $di_nomirror
- EndSwitch
- Local $aresult = DllCall("user32.dll", "bool", "DrawIconEx", "handle", $hdc, "int", $ix, "int", $iy, "handle", $hicon, "int", $iwidth, "int", $iheight, "uint", $istep, "handle", $hbrush, "uint", $ioptions)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_drawline($hdc, $ix1, $iy1, $ix2, $iy2)
- _winapi_moveto($hdc, $ix1, $iy1)
- If @error Then Return SetError(@error, @extended, False)
- _winapi_lineto($hdc, $ix2, $iy2)
- If @error Then Return SetError(@error + 10, @extended, False)
- Return True
- EndFunc
- Func _winapi_drawtext($hdc, $stext, ByRef $trect, $iflags)
- Local $aresult = DllCall("user32.dll", "int", "DrawTextW", "handle", $hdc, "wstr", $stext, "int", -1, "struct*", $trect, "uint", $iflags)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_duplicatehandle($hsoursshandleshandle, $hsourcehandle, $htargsshandleshandle, $idesiredaccess, $binherithandle, $ioptions)
- Local $aresult = DllCall("kernel32.dll", "bool", "DuplicateHandle", "handle", $hsoursshandleshandle, "handle", $hsourcehandle, "handle", $htargsshandleshandle, "handle*", 0, "dword", $idesiredaccess, "bool", $binherithandle, "dword", $ioptions)
- If @error OR NOT $aresult[0] Then Return SetError(@error, @extended, 0)
- Return $aresult[4]
- EndFunc
- Func _winapi_enablewindow($hwnd, $benable = True)
- Local $aresult = DllCall("user32.dll", "bool", "EnableWindow", "hwnd", $hwnd, "bool", $benable)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_enumdisplaydevices($sdevice, $idevnum)
- Local $tname = 0, $iflags = 0, $adevice[5]
- If $sdevice <> "" Then
- $tname = DllStructCreate("wchar Text[" & StringLen($sdevice) + 1 & "]")
- DllStructSetData($tname, "Text", $sdevice)
- EndIf
- Local $tdevice = DllStructCreate($tay_device_device)
- Local $idevice = DllStructGetSize($tdevice)
- DllStructSetData($tdevice, "Size", $idevice)
- Local $aret = DllCall("user32.dll", "bool", "EnumDevicesWevicesW", "struct*", $tname, "dword", $idevnum, "struct*", $tdevice, "dword", 1)
- If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
- Local $in = DllStructGetData($tdevice, "Flags")
- If BitAND($in, $dievice_aeva_deskto_desktopdesktop) <> 0 Then $iflags = BitOR($iflags, 1)
- If BitAND($in, $display_devicey_devicy_device) <> 0 Then $iflags = BitOR($iflags, 2)
- If BitAND($in, $display_device_mg_driveg_driver) <> 0 Then $iflags = BitOR($iflags, 4)
- If BitAND($in, $display_devicempatiblmpatible) <> 0 Then $iflags = BitOR($iflags, 8)
- If BitAND($in, $display_demovablemovable) <> 0 Then $iflags = BitOR($iflags, 16)
- If BitAND($in, $display_devespruneespruned) <> 0 Then $iflags = BitOR($iflags, 32)
- $adevice[0] = True
- $adevice[1] = DllStructGetData($tdevice, "Name")
- $adevice[2] = DllStructGetData($tdevice, "String")
- $adevice[3] = $iflags
- $adevice[4] = DllStructGetData($tdevice, "ID")
- Return $adevice
- EndFunc
- Func _winapi_enumwindows($bvisible = True, $hwnd = Default)
- __winapi_enumwindowsinit()
- If $hwnd = Default Then $hwnd = _winapi_getdesktopwindow()
- __winapi_enumwindowschild($hwnd, $bvisible)
- Return $__g_t_winapi_winapi
- EndFunc
- Func __winapi_enumwindowsadd($hwnd, $sclass = "")
- If $sclass = "" Then $sclass = _winapi_getclassname($hwnd)
- $__g_t_winapi_winapi[0][0] += 1
- Local $icount = $__g_t_winapi_winapi[0][0]
- If $icount >= $__g_t_winapi_winapi[0][1] Then
- ReDim $__g_t_winapi_winapi[$icount + 64][2]
- $__g_t_winapi_winapi[0][1] += 64
- EndIf
- $__g_t_winapi_winapi[$icount][0] = $hwnd
- $__g_t_winapi_winapi[$icount][1] = $sclass
- EndFunc
- Func __winapi_enumwindowschild($hwnd, $bvisible = True)
- $hwnd = _winapi_getwindow($hwnd, $gw_child)
- While $hwnd <> 0
- If (NOT $bvisible) OR _winapi_iswindowvisible($hwnd) Then
- __winapi_enumwindowsadd($hwnd)
- __winapi_enumwindowschild($hwnd, $bvisible)
- EndIf
- $hwnd = _winapi_getwindow($hwnd, $gw_hwndnext)
- WEnd
- EndFunc
- Func __winapi_enumwindowsinit()
- ReDim $__g_t_winapi_winapi[64][2]
- $__g_t_winapi_winapi[0][0] = 0
- $__g_t_winapi_winapi[0][1] = 64
- EndFunc
- Func _winapi_enumwindowspopup()
- __winapi_enumwindowsinit()
- Local $hwnd = _winapi_getwindow(_winapi_getdesktopwindow(), $gw_child)
- Local $sclass
- While $hwnd <> 0
- If _winapi_iswindowvisible($hwnd) Then
- $sclass = _winapi_getclassname($hwnd)
- If $sclass = "#32768" Then
- __winapi_enumwindowsadd($hwnd)
- ElseIf $sclass = "ToolbarWindow32" Then
- __winapi_enumwindowsadd($hwnd)
- ElseIf $sclass = "ToolTips_Class32" Then
- __winapi_enumwindowsadd($hwnd)
- ElseIf $sclass = "BaseBar" Then
- __winapi_enumwindowschild($hwnd)
- EndIf
- EndIf
- $hwnd = _winapi_getwindow($hwnd, $gw_hwndnext)
- WEnd
- Return $__g_t_winapi_winapi
- EndFunc
- Func _winapi_enumwindowstop()
- __winapi_enumwindowsinit()
- Local $hwnd = _winapi_getwindow(_winapi_getdesktopwindow(), $gw_child)
- While $hwnd <> 0
- If _winapi_iswindowvisible($hwnd) Then __winapi_enumwindowsadd($hwnd)
- $hwnd = _winapi_getwindow($hwnd, $gw_hwndnext)
- WEnd
- Return $__g_t_winapi_winapi
- EndFunc
- Func _winapi_expandenvironmentstrings($sstring)
- Local $aresult = DllCall("kernel32.dll", "dword", "ExpandEnviStringsStringsW", "wstr", $sstring, "wstr", "", "dword", 4096)
- If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, "")
- Return $aresult[2]
- EndFunc
- Func _winapi_extracticonex($sfile, $iindex, $plarge, $psmall, $iicons)
- Local $aresult = DllCall("shell32.dll", "uint", "ExtractIconExW", "wstr", $sfile, "int", $iindex, "struct*", $plarge, "struct*", $psmall, "uint", $iicons)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_fatalappexit($smessage)
- DllCall("kernel32.dll", "none", "FatalAppExitW", "uint", 0, "wstr", $smessage)
- If @error Then Return SetError(@error, @extended)
- EndFunc
- Func _winapi_fillrect($hdc, $prect, $hbrush)
- Local $aresult
- If IsPtr($hbrush) Then
- $aresult = DllCall("user32.dll", "int", "FillRect", "handle", $hdc, "struct*", $prect, "handle", $hbrush)
- Else
- $aresult = DllCall("user32.dll", "int", "FillRect", "handle", $hdc, "struct*", $prect, "dword_ptr", $hbrush)
- EndIf
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_findexecutable($sfilename, $sdirectory = "")
- Local $aresult = DllCall("shell32.dll", "INT", "FindExecutableW", "wstr", $sfilename, "wstr", $sdirectory, "wstr", "")
- If @error Then Return SetError(@error, @extended, "")
- If $aresult[0] <= 32 Then Return SetError(10, $aresult[0], "")
- Return SetExtended($aresult[0], $aresult[3])
- EndFunc
- Func _winapi_findwindow($sclassname, $swindowname)
- Local $aresult = DllCall("user32.dll", "hwnd", "FindWindowW", "wstr", $sclassname, "wstr", $swindowname)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_flashwindow($hwnd, $binvert = True)
- Local $aresult = DllCall("user32.dll", "bool", "FlashWindow", "hwnd", $hwnd, "bool", $binvert)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_flashwindowex($hwnd, $iflags = 3, $icount = 3, $itimeout = 0)
- Local $tflash = DllStructCreate($tagflashwinfo)
- Local $iflash = DllStructGetSize($tflash)
- Local $imode = 0
- If BitAND($iflags, 1) <> 0 Then $imode = BitOR($imode, $flashw_caption)
- If BitAND($iflags, 2) <> 0 Then $imode = BitOR($imode, $flashw_tray)
- If BitAND($iflags, 4) <> 0 Then $imode = BitOR($imode, $flashw_timer)
- If BitAND($iflags, 8) <> 0 Then $imode = BitOR($imode, $flashw_timernofg)
- DllStructSetData($tflash, "Size", $iflash)
- DllStructSetData($tflash, "hWnd", $hwnd)
- DllStructSetData($tflash, "Flags", $imode)
- DllStructSetData($tflash, "Count", $icount)
- DllStructSetData($tflash, "Timeout", $itimeout)
- Local $aresult = DllCall("user32.dll", "bool", "FlashWindowEx", "struct*", $tflash)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_floattoint($nfloat)
- Local $tfloat = DllStructCreate("float")
- Local $tint = DllStructCreate("int", DllStructGetPtr($tfloat))
- DllStructSetData($tfloat, 1, $nfloat)
- Return DllStructGetData($tint, 1)
- EndFunc
- Func _winapi_flushfilebuffers($hfile)
- Local $aresult = DllCall("kernel32.dll", "bool", "FlushFileBuffers", "handle", $hfile)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_formatmessage($iflags, $psource, $imessageid, $ilanguageid, ByRef $pbuffer, $isize, $varguments)
- Local $sbuffertype = "struct*"
- If IsString($pbuffer) Then $sbuffertype = "wstr"
- Local $aresult = DllCall("Kernel32.dll", "dword", "FormatMessageW", "dword", $iflags, "ptr", $psource, "dword", $imessageid, "dword", $ilanguageid, $sbuffertype, $pbuffer, "dword", $isize, "ptr", $varguments)
- If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, 0)
- If $sbuffertype = "wstr" Then $pbuffer = $aresult[5]
- Return $aresult[0]
- EndFunc
- Func _winapi_framerect($hdc, $prect, $hbrush)
- Local $aresult = DllCall("user32.dll", "int", "FrameRect", "handle", $hdc, "ptr", $prect, "handle", $hbrush)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_freelibrary($hmodule)
- Local $aresult = DllCall("kernel32.dll", "bool", "FreeLibrary", "handle", $hmodule)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_getancestor($hwnd, $iflags = 1)
- Local $aresult = DllCall("user32.dll", "hwnd", "GetAncestor", "hwnd", $hwnd, "uint", $iflags)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getasynckeystate($ikey)
- Local $aresult = DllCall("user32.dll", "short", "GetAsyncKeyState", "int", $ikey)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getbkmode($hdc)
- Local $aresult = DllCall("gdi32.dll", "int", "GetBkMode", "handle", $hdc)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getclassname($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Local $aresult = DllCall("user32.dll", "int", "GetClassNameW", "hwnd", $hwnd, "wstr", "", "int", 4096)
- If @error OR NOT $aresult[0] Then Return SetError(@error, @extended, "")
- Return SetExtended($aresult[0], $aresult[2])
- EndFunc
- Func _winapi_getclientheight($hwnd)
- Local $trect = _winapi_getclientrect($hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return DllStructGetData($trect, "Bottom") - DllStructGetData($trect, "Top")
- EndFunc
- Func _winapi_getclientwidth($hwnd)
- Local $trect = _winapi_getclientrect($hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return DllStructGetData($trect, "Right") - DllStructGetData($trect, "Left")
- EndFunc
- Func _winapi_getclientrect($hwnd)
- Local $trect = DllStructCreate($tagrect)
- Local $aret = DllCall("user32.dll", "bool", "GetClientRect", "hwnd", $hwnd, "struct*", $trect)
- If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
- Return $trect
- EndFunc
- Func _winapi_getcurrentprocess()
- Local $aresult = DllCall("kernel32.dll", "handle", "GetProcessProcess")
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getcurrentprocessid()
- Local $aresult = DllCall("kernel32.dll", "dword", "GetCrocessIdocessId")
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getcurrentthread()
- Local $aresult = DllCall("kernel32.dll", "handle", "GetCurrentThread")
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getcurrentthreadid()
- Local $aresult = DllCall("kernel32.dll", "dword", "GetThreadIdhreadId")
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getcursorinfo()
- Local $tcursor = DllStructCreate($tagcursorinfo)
- Local $icursor = DllStructGetSize($tcursor)
- DllStructSetData($tcursor, "Size", $icursor)
- Local $aret = DllCall("user32.dll", "bool", "GetCursorInfo", "struct*", $tcursor)
- If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
- Local $acursor[5]
- $acursor[0] = True
- $acursor[1] = DllStructGetData($tcursor, "Flags") <> 0
- $acursor[2] = DllStructGetData($tcursor, "hCursor")
- $acursor[3] = DllStructGetData($tcursor, "X")
- $acursor[4] = DllStructGetData($tcursor, "Y")
- Return $acursor
- EndFunc
- Func _winapi_getdc($hwnd)
- Local $aresult = DllCall("user32.dll", "handle", "GetDC", "hwnd", $hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getdesktopwindow()
- Local $aresult = DllCall("user32.dll", "hwnd", "GetDesktopWindow")
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getdevicecaps($hdc, $iindex)
- Local $aresult = DllCall("gdi32.dll", "int", "GetDeviceCaps", "handle", $hdc, "int", $iindex)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getdibits($hdc, $hbmp, $istartscan, $iscanlines, $pbits, $pbi, $iusage)
- Local $aresult = DllCall("gdi32.dll", "int", "GetDIBits", "handle", $hdc, "handle", $hbmp, "uint", $istartscan, "uint", $iscanlines, "ptr", $pbits, "ptr", $pbi, "uint", $iusage)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_getdlgctrlid($hwnd)
- Local $aresult = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getdlgitem($hwnd, $iitemid)
- Local $aresult = DllCall("user32.dll", "hwnd", "GetDlgItem", "hwnd", $hwnd, "int", $iitemid)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getfilesizeex($hfile)
- Local $aresult = DllCall("kernel32.dll", "bool", "GetFileSizeEx", "handle", $hfile, "int64*", 0)
- If @error OR NOT $aresult[0] Then Return SetError(@error, @extended, -1)
- Return $aresult[2]
- EndFunc
- Func _winapi_getfocus()
- Local $aresult = DllCall("user32.dll", "hwnd", "GetFocus")
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getforegroundwindow()
- Local $aresult = DllCall("user32.dll", "hwnd", "GetFndWindowdWindow")
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getguiresources($iflag = 0, $hprocess = -1)
- If $hprocess = -1 Then $hprocess = _winapi_getcurrentprocess()
- Local $aresult = DllCall("user32.dll", "dword", "GetGuiResources", "handle", $hprocess, "dword", $iflag)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_geticoninfo($hicon)
- Local $tinfo = DllStructCreate($tagiconinfo)
- Local $aret = DllCall("user32.dll", "bool", "GetIconInfo", "handle", $hicon, "struct*", $tinfo)
- If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
- Local $aicon[6]
- $aicon[0] = True
- $aicon[1] = DllStructGetData($tinfo, "Icon") <> 0
- $aicon[2] = DllStructGetData($tinfo, "XHotSpot")
- $aicon[3] = DllStructGetData($tinfo, "YHotSpot")
- $aicon[4] = DllStructGetData($tinfo, "hMask")
- $aicon[5] = DllStructGetData($tinfo, "hColor")
- Return $aicon
- EndFunc
- Func _winapi_getlasterrormessage()
- Local $ilasterror = _winapi_getlasterror()
- Local $tbufferptr = DllStructCreate("ptr")
- Local $ncount = _winapi_formatmessage(BitOR($format_message_e_buffee_buffer, $format_messm_system_system), 0, $ilasterror, 0, $tbufferptr, 0, 0)
- If @error Then Return SetError(@error, 0, "")
- Local $stext = ""
- Local $pbuffer = DllStructGetData($tbufferptr, 1)
- If $pbuffer Then
- If $ncount > 0 Then
- Local $tbuffer = DllStructCreate("wchar[" & ($ncount + 1) & "]", $pbuffer)
- $stext = DllStructGetData($tbuffer, 1)
- EndIf
- _winapi_localfree($pbuffer)
- EndIf
- Return $stext
- EndFunc
- Func _winapi_getlayeredwindowattributes($hwnd, ByRef $itranscolor, ByRef $itransparency, $bcolorref = False)
- $itranscolor = -1
- $itransparency = -1
- Local $aresult = DllCall("user32.dll", "bool", "GetLayeredWtributetributes", "hwnd", $hwnd, "INT*", $itranscolor, "byte*", $itransparency, "dword*", 0)
- If @error OR NOT $aresult[0] Then Return SetError(@error, @extended, 0)
- If NOT $bcolorref Then
- $aresult[2] = Int(BinaryMid($aresult[2], 3, 1) & BinaryMid($aresult[2], 2, 1) & BinaryMid($aresult[2], 1, 1))
- EndIf
- $itranscolor = $aresult[2]
- $itransparency = $aresult[3]
- Return $aresult[4]
- EndFunc
- Func _winapi_getmodulehandle($smodulename)
- Local $smodulenametype = "wstr"
- If $smodulename = "" Then
- $smodulename = 0
- $smodulenametype = "ptr"
- EndIf
- Local $aresult = DllCall("kernel32.dll", "handle", "GetModuleHandleW", $smodulenametype, $smodulename)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getmousepos($btoclient = False, $hwnd = 0)
- Local $imode = Opt("MouseCoordMode", 1)
- Local $apos = MouseGetPos()
- Opt("MouseCoordMode", $imode)
- Local $tpoint = DllStructCreate($tagpoint)
- DllStructSetData($tpoint, "X", $apos[0])
- DllStructSetData($tpoint, "Y", $apos[1])
- If $btoclient AND NOT _winapi_screentoclient($hwnd, $tpoint) Then Return SetError(@error + 20, @extended, 0)
- Return $tpoint
- EndFunc
- Func _winapi_getmouseposx($btoclient = False, $hwnd = 0)
- Local $tpoint = _winapi_getmousepos($btoclient, $hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return DllStructGetData($tpoint, "X")
- EndFunc
- Func _winapi_getmouseposy($btoclient = False, $hwnd = 0)
- Local $tpoint = _winapi_getmousepos($btoclient, $hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return DllStructGetData($tpoint, "Y")
- EndFunc
- Func _winapi_getobject($hobject, $isize, $pobject)
- Local $aresult = DllCall("gdi32.dll", "int", "GetObjectW", "handle", $hobject, "int", $isize, "ptr", $pobject)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getopenfilename($stitle = "", $sfilter = "All files (*.*)", $sinitaldir = ".", $sdefaultfile = "", $sdefaultext = "", $ifilterindex = 1, $iflags = 0, $iflagsex = 0, $hwndowner = 0)
- Local $ipathlen = 4096
- Local $inulls = 0
- Local $tofn = DllStructCreate($tagopenfilename)
- Local $afiles[1] = [0]
- Local $iflag = $iflags
- Local $asflines = StringSplit($sfilter, "|")
- Local $asfilter[$asflines[0] * 2 + 1]
- Local $istart, $ifinal, $tagfilter
- $asfilter[0] = $asflines[0] * 2
- For $i = 1 To $asflines[0]
- $istart = StringInStr($asflines[$i], "(", 0, 1)
- $ifinal = StringInStr($asflines[$i], ")", 0, -1)
- $asfilter[$i * 2 - 1] = StringStripWS(StringLeft($asflines[$i], $istart - 1), $str_stripleading + $sttrailingrailing)
- $asfilter[$i * 2] = StringStripWS(StringTrimRight(StringTrimLeft($asflines[$i], $istart), StringLen($asflines[$i]) - $ifinal + 1), $str_stripleading + $sttrailingrailing)
- $tagfilter &= "wchar[" & StringLen($asfilter[$i * 2 - 1]) + 1 & "];wchar[" & StringLen($asfilter[$i * 2]) + 1 & "];"
- Next
- Local $ttitle = DllStructCreate("wchar Title[" & StringLen($stitle) + 1 & "]")
- Local $tinitialdir = DllStructCreate("wchar InitDir[" & StringLen($sinitaldir) + 1 & "]")
- Local $tfilter = DllStructCreate($tagfilter & "wchar")
- Local $tpath = DllStructCreate("wchar Path[" & $ipathlen & "]")
- Local $textn = DllStructCreate("wchar Extension[" & StringLen($sdefaultext) + 1 & "]")
- For $i = 1 To $asfilter[0]
- DllStructSetData($tfilter, $i, $asfilter[$i])
- Next
- DllStructSetData($ttitle, "Title", $stitle)
- DllStructSetData($tinitialdir, "InitDir", $sinitaldir)
- DllStructSetData($tpath, "Path", $sdefaultfile)
- DllStructSetData($textn, "Extension", $sdefaultext)
- DllStructSetData($tofn, "StructSize", DllStructGetSize($tofn))
- DllStructSetData($tofn, "hwndOwner", $hwndowner)
- DllStructSetData($tofn, "lpstrFilter", DllStructGetPtr($tfilter))
- DllStructSetData($tofn, "nFilterIndex", $ifilterindex)
- DllStructSetData($tofn, "lpstrFile", DllStructGetPtr($tpath))
- DllStructSetData($tofn, "nMaxFile", $ipathlen)
- DllStructSetData($tofn, "lpstrInitialDir", DllStructGetPtr($tinitialdir))
- DllStructSetData($tofn, "lpstrTitle", DllStructGetPtr($ttitle))
- DllStructSetData($tofn, "Flags", $iflag)
- DllStructSetData($tofn, "lpstrDefExt", DllStructGetPtr($textn))
- DllStructSetData($tofn, "FlagsEx", $iflagsex)
- Local $ares = DllCall("comdlg32.dll", "bool", "GetOpenFileNameW", "struct*", $tofn)
- If @error OR NOT $ares[0] Then Return SetError(@error + 10, @extended, $afiles)
- If BitAND($iflags, $ofn_atiselectiselect) = $ofn_atiselectiselect AND BitAND($iflags, $ofn_explorer) = $ofn_explorer Then
- For $x = 1 To $ipathlen
- If DllStructGetData($tpath, "Path", $x) = Chr(0) Then
- DllStructSetData($tpath, "Path", "|", $x)
- $inulls += 1
- Else
- $inulls = 0
- EndIf
- If $inulls = 2 Then ExitLoop
- Next
- DllStructSetData($tpath, "Path", Chr(0), $x - 1)
- $afiles = StringSplit(DllStructGetData($tpath, "Path"), "|")
- If $afiles[0] = 1 Then Return __winapi_parsefiledialogpath(DllStructGetData($tpath, "Path"))
- Return StringSplit(DllStructGetData($tpath, "Path"), "|")
- ElseIf BitAND($iflags, $ofn_atiselectiselect) = $ofn_atiselectiselect Then
- $afiles = StringSplit(DllStructGetData($tpath, "Path"), " ")
- If $afiles[0] = 1 Then Return __winapi_parsefiledialogpath(DllStructGetData($tpath, "Path"))
- Return StringSplit(StringReplace(DllStructGetData($tpath, "Path"), " ", "|"), "|")
- Else
- Return __winapi_parsefiledialogpath(DllStructGetData($tpath, "Path"))
- EndIf
- EndFunc
- Func _winapi_getoverlappedresult($hfile, $poverlapped, ByRef $ibytes, $bwait = False)
- Local $aresult = DllCall("kernel32.dll", "bool", "GetOedResultdResult", "handle", $hfile, "ptr", $poverlapped, "dword*", 0, "bool", $bwait)
- If @error OR NOT $aresult[0] Then Return SetError(@error, @extended, False)
- $ibytes = $aresult[3]
- Return $aresult[0]
- EndFunc
- Func _winapi_getparent($hwnd)
- Local $aresult = DllCall("user32.dll", "hwnd", "GetParent", "hwnd", $hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getprocaddress($hmodule, $vname)
- Local $stype = "str"
- If IsNumber($vname) Then $stype = "word"
- Local $aresult = DllCall("kernel32.dll", "ptr", "GetProcAddress", "handle", $hmodule, $stype, $vname)
- If @error OR NOT $aresult[0] Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getprocessaffinitymask($hprocess)
- Local $aresult = DllCall("kernel32.dll", "bool", "GetProcnityMaskityMask", "handle", $hprocess, "dword_ptr*", 0, "dword_ptr*", 0)
- If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, 0)
- Local $amask[3]
- $amask[0] = True
- $amask[1] = $aresult[2]
- $amask[2] = $aresult[3]
- Return $amask
- EndFunc
- Func _winapi_getsavefilename($stitle = "", $sfilter = "All files (*.*)", $sinitaldir = ".", $sdefaultfile = "", $sdefaultext = "", $ifilterindex = 1, $iflags = 0, $iflagsex = 0, $hwndowner = 0)
- Local $ipathlen = 4096
- Local $tofn = DllStructCreate($tagopenfilename)
- Local $afiles[1] = [0]
- Local $iflag = $iflags
- Local $asflines = StringSplit($sfilter, "|")
- Local $asfilter[$asflines[0] * 2 + 1]
- Local $istart, $ifinal, $tagfilter
- $asfilter[0] = $asflines[0] * 2
- For $i = 1 To $asflines[0]
- $istart = StringInStr($asflines[$i], "(", 0, 1)
- $ifinal = StringInStr($asflines[$i], ")", 0, -1)
- $asfilter[$i * 2 - 1] = StringStripWS(StringLeft($asflines[$i], $istart - 1), $str_stripleading + $sttrailingrailing)
- $asfilter[$i * 2] = StringStripWS(StringTrimRight(StringTrimLeft($asflines[$i], $istart), StringLen($asflines[$i]) - $ifinal + 1), $str_stripleading + $sttrailingrailing)
- $tagfilter &= "wchar[" & StringLen($asfilter[$i * 2 - 1]) + 1 & "];wchar[" & StringLen($asfilter[$i * 2]) + 1 & "];"
- Next
- Local $ttitle = DllStructCreate("wchar Title[" & StringLen($stitle) + 1 & "]")
- Local $tinitialdir = DllStructCreate("wchar InitDir[" & StringLen($sinitaldir) + 1 & "]")
- Local $tfilter = DllStructCreate($tagfilter & "wchar")
- Local $tpath = DllStructCreate("wchar Path[" & $ipathlen & "]")
- Local $textn = DllStructCreate("wchar Extension[" & StringLen($sdefaultext) + 1 & "]")
- For $i = 1 To $asfilter[0]
- DllStructSetData($tfilter, $i, $asfilter[$i])
- Next
- DllStructSetData($ttitle, "Title", $stitle)
- DllStructSetData($tinitialdir, "InitDir", $sinitaldir)
- DllStructSetData($tpath, "Path", $sdefaultfile)
- DllStructSetData($textn, "Extension", $sdefaultext)
- DllStructSetData($tofn, "StructSize", DllStructGetSize($tofn))
- DllStructSetData($tofn, "hwndOwner", $hwndowner)
- DllStructSetData($tofn, "lpstrFilter", DllStructGetPtr($tfilter))
- DllStructSetData($tofn, "nFilterIndex", $ifilterindex)
- DllStructSetData($tofn, "lpstrFile", DllStructGetPtr($tpath))
- DllStructSetData($tofn, "nMaxFile", $ipathlen)
- DllStructSetData($tofn, "lpstrInitialDir", DllStructGetPtr($tinitialdir))
- DllStructSetData($tofn, "lpstrTitle", DllStructGetPtr($ttitle))
- DllStructSetData($tofn, "Flags", $iflag)
- DllStructSetData($tofn, "lpstrDefExt", DllStructGetPtr($textn))
- DllStructSetData($tofn, "FlagsEx", $iflagsex)
- Local $ares = DllCall("comdlg32.dll", "bool", "GetSaveFileNameW", "struct*", $tofn)
- If @error OR NOT $ares[0] Then Return SetError(@error + 10, @extended, $afiles)
- Return __winapi_parsefiledialogpath(DllStructGetData($tpath, "Path"))
- EndFunc
- Func _winapi_getstockobject($iobject)
- Local $aresult = DllCall("gdi32.dll", "handle", "GetStockObject", "int", $iobject)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getstdhandle($istdhandle)
- If $istdhandle < 0 OR $istdhandle > 2 Then Return SetError(2, 0, -1)
- Local Const $ahandle[3] = [-10, -11, -12]
- Local $aresult = DllCall("kernel32.dll", "handle", "GetStdHandle", "dword", $ahandle[$istdhandle])
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_getsyscolor($iindex)
- Local $aresult = DllCall("user32.dll", "INT", "GetSysColor", "int", $iindex)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getsyscolorbrush($iindex)
- Local $aresult = DllCall("user32.dll", "handle", "GetSysColorBrush", "int", $iindex)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getsystemmetrics($iindex)
- Local $aresult = DllCall("user32.dll", "int", "GetSystemMetrics", "int", $iindex)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_gettextextentpoint32($hdc, $stext)
- Local $tsize = DllStructCreate($tagsize)
- Local $isize = StringLen($stext)
- Local $aret = DllCall("gdi32.dll", "bool", "GetTexPoint32Woint32W", "handle", $hdc, "wstr", $stext, "int", $isize, "struct*", $tsize)
- If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
- Return $tsize
- EndFunc
- Func _winapi_gettextmetrics($hdc)
- Local $ttextmetric = DllStructCreate($tagtextmetric)
- Local $aret = DllCall("gdi32.dll", "bool", "GetTextMetricsW", "handle", $hdc, "struct*", $ttextmetric)
- If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
- Return $ttextmetric
- EndFunc
- Func _winapi_getwindow($hwnd, $icmd)
- Local $aresult = DllCall("user32.dll", "hwnd", "GetWindow", "hwnd", $hwnd, "uint", $icmd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getwindowdc($hwnd)
- Local $aresult = DllCall("user32.dll", "handle", "GetWindowDC", "hwnd", $hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getwindowheight($hwnd)
- Local $trect = _winapi_getwindowrect($hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return DllStructGetData($trect, "Bottom") - DllStructGetData($trect, "Top")
- EndFunc
- Func _winapi_getwindowlong($hwnd, $iindex)
- Local $sfuncname = "GetWindowLongW"
- If @AutoItX64 Then $sfuncname = "GeLongPtrWongPtrW"
- Local $aresult = DllCall("user32.dll", "long_ptr", $sfuncname, "hwnd", $hwnd, "int", $iindex)
- If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getwindowplacement($hwnd)
- Local $twindowplacement = DllStructCreate($taglacementacement)
- DllStructSetData($twindowplacement, "length", DllStructGetSize($twindowplacement))
- Local $aret = DllCall("user32.dll", "bool", "Getlacementacement", "hwnd", $hwnd, "struct*", $twindowplacement)
- If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
- Return $twindowplacement
- EndFunc
- Func _winapi_getwindowrect($hwnd)
- Local $trect = DllStructCreate($tagrect)
- Local $aret = DllCall("user32.dll", "bool", "GetWindowRect", "hwnd", $hwnd, "struct*", $trect)
- If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
- Return $trect
- EndFunc
- Func _winapi_getwindowrgn($hwnd, $hrgn)
- Local $aresult = DllCall("user32.dll", "int", "GetWindowRgn", "hwnd", $hwnd, "handle", $hrgn)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_getwindowtext($hwnd)
- Local $aresult = DllCall("user32.dll", "int", "GetWindowTextW", "hwnd", $hwnd, "wstr", "", "int", 4096)
- If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, "")
- Return SetExtended($aresult[0], $aresult[2])
- EndFunc
- Func _winapi_getwindowthreadprocessid($hwnd, ByRef $ipid)
- Local $aresult = DllCall("user32.dll", "dword", "GetWindowrocessIrocessId", "hwnd", $hwnd, "dword*", 0)
- If @error Then Return SetError(@error, @extended, 0)
- $ipid = $aresult[2]
- Return $aresult[0]
- EndFunc
- Func _winapi_getwindowwidth($hwnd)
- Local $trect = _winapi_getwindowrect($hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return DllStructGetData($trect, "Right") - DllStructGetData($trect, "Left")
- EndFunc
- Func _winapi_getxyfrompoint(ByRef $tpoint, ByRef $ix, ByRef $iy)
- $ix = DllStructGetData($tpoint, "X")
- $iy = DllStructGetData($tpoint, "Y")
- EndFunc
- Func _winapi_globalmemorystatus()
- Local $tmem = DllStructCreate($tastatusextatusex)
- DllStructSetData($tmem, 1, DllStructGetSize($tmem))
- Local $aret = DllCall("kernel32.dll", "bool", "GlobaStatusExtatusEx", "struct*", $tmem)
- If @error OR NOT $aret[0] Then Return SetError(@error + 10, @extended, 0)
- Local $amem[7]
- $amem[0] = DllStructGetData($tmem, 2)
- $amem[1] = DllStructGetData($tmem, 3)
- $amem[2] = DllStructGetData($tmem, 4)
- $amem[3] = DllStructGetData($tmem, 5)
- $amem[4] = DllStructGetData($tmem, 6)
- $amem[5] = DllStructGetData($tmem, 7)
- $amem[6] = DllStructGetData($tmem, 8)
- Return $amem
- EndFunc
- Func _winapi_guidfromstring($sguid)
- Local $tguid = DllStructCreate($tagguid)
- _winapi_guidfromstringex($sguid, $tguid)
- If @error Then Return SetError(@error + 10, @extended, 0)
- Return $tguid
- EndFunc
- Func _winapi_guidfromstringex($sguid, $pguid)
- Local $aresult = DllCall("ole32.dll", "long", "CLSIDFromString", "wstr", $sguid, "struct*", $pguid)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_hiword($ilong)
- Return BitShift($ilong, 16)
- EndFunc
- Func _winapi_inprocess($hwnd, ByRef $hlastwnd)
- If $hwnd = $hlastwnd Then Return True
- For $ii = $__g_ais_winapi_winapi[0][0] To 1 Step -1
- If $hwnd = $__g_ais_winapi_winapi[$ii][0] Then
- If $__g_ais_winapi_winapi[$ii][1] Then
- $hlastwnd = $hwnd
- Return True
- Else
- Return False
- EndIf
- EndIf
- Next
- Local $ipid
- _winapi_getwindowthreadprocessid($hwnd, $ipid)
- Local $icount = $__g_ais_winapi_winapi[0][0] + 1
- If $icount >= 64 Then $icount = 1
- $__g_ais_winapi_winapi[0][0] = $icount
- $__g_ais_winapi_winapi[$icount][0] = $hwnd
- $__g_ais_winapi_winapi[$icount][1] = ($ipid = @AutoItPID)
- Return $__g_ais_winapi_winapi[$icount][1]
- EndFunc
- Func _winapi_inttofloat($iint)
- Local $tint = DllStructCreate("int")
- Local $tfloat = DllStructCreate("float", DllStructGetPtr($tint))
- DllStructSetData($tint, 1, $iint)
- Return DllStructGetData($tfloat, 1)
- EndFunc
- Func _winapi_isclassname($hwnd, $sclassname)
- Local $sseparator = Opt("GUIDaatorChartorChar")
- Local $aclassname = StringSplit($sclassname, $sseparator)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Local $sclasscheck = _winapi_getclassname($hwnd)
- For $x = 1 To UBound($aclassname) - 1
- If StringUpper(StringMid($sclasscheck, 1, StringLen($aclassname[$x]))) = StringUpper($aclassname[$x]) Then Return True
- Next
- Return False
- EndFunc
- Func _winapi_iswindow($hwnd)
- Local $aresult = DllCall("user32.dll", "bool", "IsWindow", "hwnd", $hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_iswindowvisible($hwnd)
- Local $aresult = DllCall("user32.dll", "bool", "IsWindowVisible", "hwnd", $hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_invalidaterect($hwnd, $trect = 0, $berase = True)
- Local $aresult = DllCall("user32.dll", "bool", "InvalidateRect", "hwnd", $hwnd, "struct*", $trect, "bool", $berase)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_lineto($hdc, $ix, $iy)
- Local $aresult = DllCall("gdi32.dll", "bool", "LineTo", "handle", $hdc, "int", $ix, "int", $iy)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_loadbitmap($hinstance, $sbitmap)
- Local $sbitmaptype = "int"
- If IsString($sbitmap) Then $sbitmaptype = "wstr"
- Local $aresult = DllCall("user32.dll", "handle", "LoadBitmapW", "handle", $hinstance, $sbitmaptype, $sbitmap)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_loadimage($hinstance, $simage, $itype, $ixdesired, $iydesired, $iload)
- Local $aresult, $simagetype = "int"
- If IsString($simage) Then $simagetype = "wstr"
- $aresult = DllCall("user32.dll", "handle", "LoadImageW", "handle", $hinstance, $simagetype, $simage, "uint", $itype, "int", $ixdesired, "int", $iydesired, "uint", $iload)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_loadlibrary($sfilename)
- Local $aresult = DllCall("kernel32.dll", "handle", "LoadLibraryW", "wstr", $sfilename)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_loadlibraryex($sfilename, $iflags = 0)
- Local $aresult = DllCall("kernel32.dll", "handle", "LoadLibraryExW", "wstr", $sfilename, "ptr", 0, "dword", $iflags)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_loadshell32icon($iiconid)
- Local $ticons = DllStructCreate("ptr Data")
- Local $iicons = _winapi_extracticonex("shell32.dll", $iiconid, 0, $ticons, 1)
- If @error Then Return SetError(@error, @extended, 0)
- If $iicons <= 0 Then Return SetError(10, 0, 0)
- Return DllStructGetData($ticons, "Data")
- EndFunc
- Func _winapi_loadstring($hinstance, $istringid)
- Local $aresult = DllCall("user32.dll", "int", "LoadStringW", "handle", $hinstance, "uint", $istringid, "wstr", "", "int", 4096)
- If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, "")
- Return SetExtended($aresult[0], $aresult[3])
- EndFunc
- Func _winapi_localfree($hmem)
- Local $aresult = DllCall("kernel32.dll", "handle", "LocalFree", "handle", $hmem)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_loword($ilong)
- Return BitAND($ilong, 65535)
- EndFunc
- Func _winapi_makelangid($iprimary, $isub)
- Return BitOR(BitShift($isub, -10), $iprimary)
- EndFunc
- Func _winapi_makelcid($ilgid, $isrtid)
- Return BitOR(BitShift($isrtid, -16), $ilgid)
- EndFunc
- Func _winapi_makelong($ilo, $ihi)
- Return BitOR(BitShift($ihi, -16), BitAND($ilo, 65535))
- EndFunc
- Func _winapi_makeqword($ilodword, $ihidword)
- Local $tint64 = DllStructCreate("uint64")
- Local $tdwords = DllStructCreate("dword;dword", DllStructGetPtr($tint64))
- DllStructSetData($tdwords, 1, $ilodword)
- DllStructSetData($tdwords, 2, $ihidword)
- Return DllStructGetData($tint64, 1)
- EndFunc
- Func _winapi_messagebeep($itype = 1)
- Local $isound
- Switch $itype
- Case 1
- $isound = 0
- Case 2
- $isound = 16
- Case 3
- $isound = 32
- Case 4
- $isound = 48
- Case 5
- $isound = 64
- Case Else
- $isound = -1
- EndSwitch
- Local $aresult = DllCall("user32.dll", "bool", "MessageBeep", "uint", $isound)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_msgbox($iflags, $stitle, $stext)
- BlockInput(0)
- MsgBox($iflags, $stitle, $stext & " ")
- EndFunc
- Func _winapi_mouse_event($iflags, $ix = 0, $iy = 0, $idata = 0, $iextrainfo = 0)
- DllCall("user32.dll", "none", "mouse_event", "dword", $iflags, "dword", $ix, "dword", $iy, "dword", $idata, "ulong_ptr", $iextrainfo)
- If @error Then Return SetError(@error, @extended)
- EndFunc
- Func _winapi_moveto($hdc, $ix, $iy)
- Local $aresult = DllCall("gdi32.dll", "bool", "MoveToEx", "handle", $hdc, "int", $ix, "int", $iy, "ptr", 0)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_movewindow($hwnd, $ix, $iy, $iwidth, $iheight, $brepaint = True)
- Local $aresult = DllCall("user32.dll", "bool", "MoveWindow", "hwnd", $hwnd, "int", $ix, "int", $iy, "int", $iwidth, "int", $iheight, "bool", $brepaint)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_muldiv($inumber, $inumerator, $idenominator)
- Local $aresult = DllCall("kernel32.dll", "int", "MulDiv", "int", $inumber, "int", $inumerator, "int", $idenominator)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_multibytetowidechar($stext, $icodepage = 0, $iflags = 0, $bretstring = False)
- Local $stexttype = "str"
- If NOT IsString($stext) Then $stexttype = "struct*"
- Local $aresult = DllCall("kernel32.dll", "int", "MultWideCharideChar", "uint", $icodepage, "dword", $iflags, $stexttype, $stext, "int", -1, "ptr", 0, "int", 0)
- If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, 0)
- Local $iout = $aresult[0]
- Local $tout = DllStructCreate("wchar[" & $iout & "]")
- $aresult = DllCall("kernel32.dll", "int", "MultWideCharideChar", "uint", $icodepage, "dword", $iflags, $stexttype, $stext, "int", -1, "struct*", $tout, "int", $iout)
- If @error OR NOT $aresult[0] Then Return SetError(@error + 20, @extended, 0)
- If $bretstring Then Return DllStructGetData($tout, 1)
- Return $tout
- EndFunc
- Func _winapi_multibytetowidecharex($stext, $ptext, $icodepage = 0, $iflags = 0)
- Local $aresult = DllCall("kernel32.dll", "int", "MultWideCharideChar", "uint", $icodepage, "dword", $iflags, "STR", $stext, "int", -1, "struct*", $ptext, "int", (StringLen($stext) + 1) * 2)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_openprocess($iaccess, $binherit, $ipid, $bdebugpriv = False)
- Local $aresult = DllCall("kernel32.dll", "handle", "OpenProcess", "dword", $iaccess, "bool", $binherit, "dword", $ipid)
- If @error Then Return SetError(@error, @extended, 0)
- If $aresult[0] Then Return $aresult[0]
- If NOT $bdebugpriv Then Return SetError(100, 0, 0)
- Local $htoken = _security__openthreadtokenex(BitOR($token_adivilegesvileges, $token_query))
- If @error Then Return SetError(@error + 10, @extended, 0)
- _security__setprivilege($htoken, "SeDebugPrivilege", True)
- Local $ierror = @error
- Local $iextended = @extended
- Local $iret = 0
- If NOT @error Then
- $aresult = DllCall("kernel32.dll", "handle", "OpenProcess", "dword", $iaccess, "bool", $binherit, "dword", $ipid)
- $ierror = @error
- $iextended = @extended
- If $aresult[0] Then $iret = $aresult[0]
- _security__setprivilege($htoken, "SeDebugPrivilege", False)
- If @error Then
- $ierror = @error + 20
- $iextended = @extended
- EndIf
- Else
- $ierror = @error + 30
- EndIf
- _winapi_closehandle($htoken)
- Return SetError($ierror, $iextended, $iret)
- EndFunc
- Func __winapi_parsefiledialogpath($spath)
- Local $afiles[3]
- $afiles[0] = 2
- Local $stemp = StringMid($spath, 1, StringInStr($spath, "\", 0, -1) - 1)
- $afiles[1] = $stemp
- $afiles[2] = StringMid($spath, StringInStr($spath, "\", 0, -1) + 1)
- Return $afiles
- EndFunc
- Func _winapi_pathfindonpath(Const $sfile, $aextrapaths = "", Const $spathdelimiter = @LF)
- Local $iextracount = 0
- If IsString($aextrapaths) Then
- If StringLen($aextrapaths) Then
- $aextrapaths = StringSplit($aextrapaths, $spathdelimiter, $str_entiresplit + $str_nocount)
- $iextracount = UBound($aextrapaths, $ubound_rows)
- EndIf
- ElseIf IsArray($aextrapaths) Then
- $iextracount = UBound($aextrapaths)
- EndIf
- Local $tpaths, $tpathptrs
- If $iextracount Then
- Local $tagstruct = ""
- For $path In $aextrapaths
- $tagstruct &= "wchar[" & StringLen($path) + 1 & "];"
- Next
- $tpaths = DllStructCreate($tagstruct)
- $tpathptrs = DllStructCreate("ptr[" & $iextracount + 1 & "]")
- For $i = 1 To $iextracount
- DllStructSetData($tpaths, $i, $aextrapaths[$i - 1])
- DllStructSetData($tpathptrs, 1, DllStructGetPtr($tpaths, $i), $i)
- Next
- DllStructSetData($tpathptrs, 1, Ptr(0), $iextracount + 1)
- EndIf
- Local $aresult = DllCall("shlwapi.dll", "bool", "PathFindOnPathW", "wstr", $sfile, "struct*", $tpathptrs)
- If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, $sfile)
- Return $aresult[1]
- EndFunc
- Func _winapi_pointfromrect(ByRef $trect, $bcenter = True)
- Local $ix1 = DllStructGetData($trect, "Left")
- Local $iy1 = DllStructGetData($trect, "Top")
- Local $ix2 = DllStructGetData($trect, "Right")
- Local $iy2 = DllStructGetData($trect, "Bottom")
- If $bcenter Then
- $ix1 = $ix1 + (($ix2 - $ix1) / 2)
- $iy1 = $iy1 + (($iy2 - $iy1) / 2)
- EndIf
- Local $tpoint = DllStructCreate($tagpoint)
- DllStructSetData($tpoint, "X", $ix1)
- DllStructSetData($tpoint, "Y", $iy1)
- Return $tpoint
- EndFunc
- Func _winapi_postmessage($hwnd, $imsg, $iwparam, $ilparam)
- Local $aresult = DllCall("user32.dll", "bool", "PostMessage", "hwnd", $hwnd, "uint", $imsg, "wparam", $iwparam, "lparam", $ilparam)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_primarylangid($ilgid)
- Return BitAND($ilgid, 1023)
- EndFunc
- Func _winapi_ptinrect(ByRef $trect, ByRef $tpoint)
- Local $aresult = DllCall("user32.dll", "bool", "PtInRect", "struct*", $trect, "struct", $tpoint)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_readfile($hfile, $pbuffer, $itoread, ByRef $iread, $poverlapped = 0)
- Local $aresult = DllCall("kernel32.dll", "bool", "ReadFile", "handle", $hfile, "ptr", $pbuffer, "dword", $itoread, "dword*", 0, "ptr", $poverlapped)
- If @error Then Return SetError(@error, @extended, False)
- $iread = $aresult[4]
- Return $aresult[0]
- EndFunc
- Func _winapi_readprocessmemory($hprocess, $pbaseaddress, $pbuffer, $isize, ByRef $iread)
- Local $aresult = DllCall("kernel32.dll", "bool", "RessMemorysMemory", "handle", $hprocess, "ptr", $pbaseaddress, "ptr", $pbuffer, "ulong_ptr", $isize, "ulong_ptr*", 0)
- If @error Then Return SetError(@error, @extended, False)
- $iread = $aresult[5]
- Return $aresult[0]
- EndFunc
- Func _winapi_rectisempty(ByRef $trect)
- Return (DllStructGetData($trect, "Left") = 0) AND (DllStructGetData($trect, "Top") = 0) AND (DllStructGetData($trect, "Right") = 0) AND (DllStructGetData($trect, "Bottom") = 0)
- EndFunc
- Func _winapi_redrawwindow($hwnd, $trect = 0, $hregion = 0, $iflags = 5)
- Local $aresult = DllCall("user32.dll", "bool", "RedrawWindow", "hwnd", $hwnd, "struct*", $trect, "handle", $hregion, "uint", $iflags)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_registerwindowmessage($smessage)
- Local $aresult = DllCall("user32.dll", "uint", "RegisteMessageWessageW", "wstr", $smessage)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_releasecapture()
- Local $aresult = DllCall("user32.dll", "bool", "ReleaseCapture")
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_releasedc($hwnd, $hdc)
- Local $aresult = DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $hwnd, "handle", $hdc)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_screentoclient($hwnd, ByRef $tpoint)
- Local $aresult = DllCall("user32.dll", "bool", "ScreenToClient", "hwnd", $hwnd, "struct*", $tpoint)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_selectobject($hdc, $hgdiobj)
- Local $aresult = DllCall("gdi32.dll", "handle", "SelectObject", "handle", $hdc, "handle", $hgdiobj)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setbkcolor($hdc, $icolor)
- Local $aresult = DllCall("gdi32.dll", "INT", "SetBkColor", "handle", $hdc, "INT", $icolor)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_setbkmode($hdc, $ibkmode)
- Local $aresult = DllCall("gdi32.dll", "int", "SetBkMode", "handle", $hdc, "int", $ibkmode)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_setcapture($hwnd)
- Local $aresult = DllCall("user32.dll", "hwnd", "SetCapture", "hwnd", $hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_setcursor($hcursor)
- Local $aresult = DllCall("user32.dll", "handle", "SetCursor", "handle", $hcursor)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_setdefaultprinter($sprinter)
- Local $aresult = DllCall("winspool.drv", "bool", "SetPrinterWrinterW", "wstr", $sprinter)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setdibits($hdc, $hbmp, $istartscan, $iscanlines, $pbits, $pbmi, $icoloruse = 0)
- Local $aresult = DllCall("gdi32.dll", "int", "SetDIBits", "handle", $hdc, "handle", $hbmp, "uint", $istartscan, "uint", $iscanlines, "ptr", $pbits, "ptr", $pbmi, "INT", $icoloruse)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setendoffile($hfile)
- Local $aresult = DllCall("kernel32.dll", "bool", "SetEndOfFile", "handle", $hfile)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setevent($hevent)
- Local $aresult = DllCall("kernel32.dll", "bool", "SetEvent", "handle", $hevent)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setfilepointer($hfile, $ipos, $imethod = 0)
- Local $aresult = DllCall("kernel32.dll", "INT", "SetFilePointer", "handle", $hfile, "long", $ipos, "ptr", 0, "long", $imethod)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_setfocus($hwnd)
- Local $aresult = DllCall("user32.dll", "hwnd", "SetFocus", "hwnd", $hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_setfont($hwnd, $hfont, $bredraw = True)
- _sendmessage($hwnd, $__winapicons_setfon_setfont, $hfont, $bredraw, 0, "hwnd")
- EndFunc
- Func _winapi_sethandleinformation($hobject, $imask, $iflags)
- Local $aresult = DllCall("kernel32.dll", "bool", "SetHaormationrmation", "handle", $hobject, "dword", $imask, "dword", $iflags)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setlayeredwindowattributes($hwnd, $itranscolor, $itransgui = 255, $iflags = 3, $bcolorref = False)
- If $iflags = Default OR $iflags = "" OR $iflags < 0 Then $iflags = 3
- If NOT $bcolorref Then
- $itranscolor = Int(BinaryMid($itranscolor, 3, 1) & BinaryMid($itranscolor, 2, 1) & BinaryMid($itranscolor, 1, 1))
- EndIf
- Local $aresult = DllCall("user32.dll", "bool", "SetLayeredWtributetributes", "hwnd", $hwnd, "INT", $itranscolor, "byte", $itransgui, "dword", $iflags)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setparent($hwndchild, $hwndparent)
- Local $aresult = DllCall("user32.dll", "hwnd", "SetParent", "hwnd", $hwndchild, "hwnd", $hwndparent)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_setprocessaffinitymask($hprocess, $imask)
- Local $aresult = DllCall("kernel32.dll", "bool", "SetProcnityMaskityMask", "handle", $hprocess, "ulong_ptr", $imask)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setsyscolors($velements, $vcolors)
- Local $bisearray = IsArray($velements), $biscarray = IsArray($vcolors)
- Local $ielementnum
- If NOT $biscarray AND NOT $bisearray Then
- $ielementnum = 1
- ElseIf $biscarray OR $bisearray Then
- If NOT $biscarray OR NOT $bisearray Then Return SetError(-1, -1, False)
- If UBound($velements) <> UBound($vcolors) Then Return SetError(-1, -1, False)
- $ielementnum = UBound($velements)
- EndIf
- Local $telements = DllStructCreate("int Element[" & $ielementnum & "]")
- Local $tcolors = DllStructCreate("INT NewColor[" & $ielementnum & "]")
- If NOT $bisearray Then
- DllStructSetData($telements, "Element", $velements, 1)
- Else
- For $x = 0 To $ielementnum - 1
- DllStructSetData($telements, "Element", $velements[$x], $x + 1)
- Next
- EndIf
- If NOT $biscarray Then
- DllStructSetData($tcolors, "NewColor", $vcolors, 1)
- Else
- For $x = 0 To $ielementnum - 1
- DllStructSetData($tcolors, "NewColor", $vcolors[$x], $x + 1)
- Next
- EndIf
- Local $aresult = DllCall("user32.dll", "bool", "SetSysColors", "int", $ielementnum, "struct*", $telements, "struct*", $tcolors)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_settextcolor($hdc, $icolor)
- Local $aresult = DllCall("gdi32.dll", "INT", "SetTextColor", "handle", $hdc, "INT", $icolor)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_setwindowlong($hwnd, $iindex, $ivalue)
- _winapi_setlasterror(0)
- Local $sfuncname = "SetWindowLongW"
- If @AutoItX64 Then $sfuncname = "SeLongPtrWongPtrW"
- Local $aresult = DllCall("user32.dll", "long_ptr", $sfuncname, "hwnd", $hwnd, "int", $iindex, "long_ptr", $ivalue)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_setwindowplacement($hwnd, $pwindowplacement)
- Local $aresult = DllCall("user32.dll", "bool", "Setlacementacement", "hwnd", $hwnd, "ptr", $pwindowplacement)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setwindowpos($hwnd, $hafter, $ix, $iy, $icx, $icy, $iflags)
- Local $aresult = DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $hwnd, "hwnd", $hafter, "int", $ix, "int", $iy, "int", $icx, "int", $icy, "uint", $iflags)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setwindowrgn($hwnd, $hrgn, $bredraw = True)
- Local $aresult = DllCall("user32.dll", "int", "SetWindowRgn", "hwnd", $hwnd, "handle", $hrgn, "bool", $bredraw)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_setwindowshookex($idhook, $pfn, $hmod, $ithreadid = 0)
- Local $aresult = DllCall("user32.dll", "handle", "SetWindowsHookEx", "int", $idhook, "ptr", $pfn, "handle", $hmod, "dword", $ithreadid)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_setwindowtext($hwnd, $stext)
- Local $aresult = DllCall("user32.dll", "bool", "SetWindowTextW", "hwnd", $hwnd, "wstr", $stext)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_showcursor($bshow)
- Local $aresult = DllCall("user32.dll", "int", "ShowCursor", "bool", $bshow)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_showerror($stext, $bexit = True)
- _winapi_msgbox($mb_systemmodal, "Error", $stext)
- If $bexit Then Exit
- EndFunc
- Func _winapi_showmsg($stext)
- _winapi_msgbox($mb_systemmodal, "Information", $stext)
- EndFunc
- Func _winapi_showwindow($hwnd, $icmdshow = 5)
- Local $aresult = DllCall("user32.dll", "bool", "ShowWindow", "hwnd", $hwnd, "int", $icmdshow)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_stringfromguid($pguid)
- Local $aresult = DllCall("ole32.dll", "int", "StringFromGUID2", "struct*", $pguid, "wstr", "", "int", 40)
- If @error OR NOT $aresult[0] Then Return SetError(@error, @extended, "")
- Return SetExtended($aresult[0], $aresult[2])
- EndFunc
- Func _winapi_stringlena(Const ByRef $tstring)
- Local $aresult = DllCall("kernel32.dll", "int", "lstrlenA", "struct*", $tstring)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_stringlenw(Const ByRef $tstring)
- Local $aresult = DllCall("kernel32.dll", "int", "lstrlenW", "struct*", $tstring)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_sublangid($ilgid)
- Return BitShift($ilgid, 10)
- EndFunc
- Func _winapi_systemparametersinfo($iaction, $iparam = 0, $vparam = 0, $iwinini = 0)
- Local $aresult = DllCall("user32.dll", "bool", "SystemersInfoWrsInfoW", "uint", $iaction, "uint", $iparam, "ptr", $vparam, "uint", $iwinini)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_twipsperpixelx()
- Local $hdc, $itwipsperpixelx
- $hdc = _winapi_getdc(0)
- $itwipsperpixelx = 1440 / _winapi_getdevicecaps($hdc, $__winapiconsgpixelsgpixelsx)
- _winapi_releasedc(0, $hdc)
- Return $itwipsperpixelx
- EndFunc
- Func _winapi_twipsperpixely()
- Local $hdc, $itwipsperpixely
- $hdc = _winapi_getdc(0)
- $itwipsperpixely = 1440 / _winapi_getdevicecaps($hdc, $__winapiconsgpixelsgpixelsy)
- _winapi_releasedc(0, $hdc)
- Return $itwipsperpixely
- EndFunc
- Func _winapi_unhookwindowshookex($hhk)
- Local $aresult = DllCall("user32.dll", "bool", "UnhowsHookExsHookEx", "handle", $hhk)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_updatelayeredwindow($hwnd, $hdcdest, $pptdest, $psize, $hdcsrce, $pptsrce, $irgb, $pblend, $iflags)
- Local $aresult = DllCall("user32.dll", "bool", "UpdaedWindowdWindow", "hwnd", $hwnd, "handle", $hdcdest, "ptr", $pptdest, "ptr", $psize, "handle", $hdcsrce, "ptr", $pptsrce, "dword", $irgb, "ptr", $pblend, "dword", $iflags)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_updatewindow($hwnd)
- Local $aresult = DllCall("user32.dll", "bool", "UpdateWindow", "hwnd", $hwnd)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_waitforinputidle($hprocess, $itimeout = -1)
- Local $aresult = DllCall("user32.dll", "dword", "WaitForInputIdle", "handle", $hprocess, "dword", $itimeout)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_waitformultipleobjects($icount, $phandles, $bwaitall = False, $itimeout = -1)
- Local $aresult = DllCall("kernel32.dll", "INT", "WaitForeObjectsObjects", "dword", $icount, "ptr", $phandles, "bool", $bwaitall, "dword", $itimeout)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_waitforsingleobject($hhandle, $itimeout = -1)
- Local $aresult = DllCall("kernel32.dll", "INT", "WaitleObjecteObject", "handle", $hhandle, "dword", $itimeout)
- If @error Then Return SetError(@error, @extended, -1)
- Return $aresult[0]
- EndFunc
- Func _winapi_widechartomultibyte($punicode, $icodepage = 0, $bretstring = True)
- Local $sunicodetype = "wstr"
- If NOT IsString($punicode) Then $sunicodetype = "struct*"
- Local $aresult = DllCall("kernel32.dll", "int", "WideultiByteltiByte", "uint", $icodepage, "dword", 0, $sunicodetype, $punicode, "int", -1, "ptr", 0, "int", 0, "ptr", 0, "ptr", 0)
- If @error OR NOT $aresult[0] Then Return SetError(@error + 20, @extended, "")
- Local $tmultibyte = DllStructCreate("char[" & $aresult[0] & "]")
- $aresult = DllCall("kernel32.dll", "int", "WideultiByteltiByte", "uint", $icodepage, "dword", 0, $sunicodetype, $punicode, "int", -1, "struct*", $tmultibyte, "int", $aresult[0], "ptr", 0, "ptr", 0)
- If @error OR NOT $aresult[0] Then Return SetError(@error + 10, @extended, "")
- If $bretstring Then Return DllStructGetData($tmultibyte, 1)
- Return $tmultibyte
- EndFunc
- Func _winapi_windowfrompoint(ByRef $tpoint)
- Local $aresult = DllCall("user32.dll", "hwnd", "WindowFromPoint", "struct", $tpoint)
- If @error Then Return SetError(@error, @extended, 0)
- Return $aresult[0]
- EndFunc
- Func _winapi_writeconsole($hconsole, $stext)
- Local $aresult = DllCall("kernel32.dll", "bool", "WriteConsoleW", "handle", $hconsole, "wstr", $stext, "dword", StringLen($stext), "dword*", 0, "ptr", 0)
- If @error Then Return SetError(@error, @extended, False)
- Return $aresult[0]
- EndFunc
- Func _winapi_writefile($hfile, $pbuffer, $itowrite, ByRef $iwritten, $poverlapped = 0)
- Local $aresult = DllCall("kernel32.dll", "bool", "WriteFile", "handle", $hfile, "ptr", $pbuffer, "dword", $itowrite, "dword*", 0, "ptr", $poverlapped)
- If @error Then Return SetError(@error, @extended, False)
- $iwritten = $aresult[4]
- Return $aresult[0]
- EndFunc
- Func _winapi_writeprocessmemory($hprocess, $pbaseaddress, $pbuffer, $isize, ByRef $iwritten, $sbuffer = "ptr")
- Local $aresult = DllCall("kernel32.dll", "bool", "WrissMemorysMemory", "handle", $hprocess, "ptr", $pbaseaddress, $sbuffer, $pbuffer, "ulong_ptr", $isize, "ulong_ptr*", 0)
- If @error Then Return SetError(@error, @extended, False)
- $iwritten = $aresult[5]
- Return $aresult[0]
- EndFunc
- Global Const $_udf_gs_offset_offset = 2
- Global Const $_udf_g_max_winmax_win = 16
- Global Const $_udf_startid = 10000
- Global Const $_udf_g_max_idsmax_ids = 55535
- Global Const $__udfguicons_tabsto_tabstop = 65536
- Global Const $__udfguicons_visibl_visible = 268435456
- Global Const $__udfguicows_chilws_child = 1073741824
- Global $__g_audfids_usedds_used[$_udf_g_max_winmax_win][$_udf_g_max_idsmax_ids + $_udf_gs_offset_offset + 1]
- Func __udf_getnextglobalid($hwnd)
- Local $nctrlid, $iusedindex = -1, $ballused = True
- If NOT WinExists($hwnd) Then Return SetError(-1, -1, 0)
- For $iindex = 0 To $_udf_g_max_winmax_win - 1
- If $__g_audfids_usedds_used[$iindex][0] <> 0 Then
- If NOT WinExists($__g_audfids_usedds_used[$iindex][0]) Then
- For $x = 0 To UBound($__g_audfids_usedds_used, $ubound_columns) - 1
- $__g_audfids_usedds_used[$iindex][$x] = 0
- Next
- $__g_audfids_usedds_used[$iindex][1] = $_udf_startid
- $ballused = False
- EndIf
- EndIf
- Next
- For $iindex = 0 To $_udf_g_max_winmax_win - 1
- If $__g_audfids_usedds_used[$iindex][0] = $hwnd Then
- $iusedindex = $iindex
- ExitLoop
- EndIf
- Next
- If $iusedindex = -1 Then
- For $iindex = 0 To $_udf_g_max_winmax_win - 1
- If $__g_audfids_usedds_used[$iindex][0] = 0 Then
- $__g_audfids_usedds_used[$iindex][0] = $hwnd
- $__g_audfids_usedds_used[$iindex][1] = $_udf_startid
- $ballused = False
- $iusedindex = $iindex
- ExitLoop
- EndIf
- Next
- EndIf
- If $iusedindex = -1 AND $ballused Then Return SetError(16, 0, 0)
- If $__g_audfids_usedds_used[$iusedindex][1] = $_udf_startid + $_udf_g_max_idsmax_ids Then
- For $iidindex = $_udf_gs_offset_offset To UBound($__g_audfids_usedds_used, $ubound_columns) - 1
- If $__g_audfids_usedds_used[$iusedindex][$iidindex] = 0 Then
- $nctrlid = ($iidindex - $_udf_gs_offset_offset) + 10000
- $__g_audfids_usedds_used[$iusedindex][$iidindex] = $nctrlid
- Return $nctrlid
- EndIf
- Next
- Return SetError(-1, $_udf_g_max_idsmax_ids, 0)
- EndIf
- $nctrlid = $__g_audfids_usedds_used[$iusedindex][1]
- $__g_audfids_usedds_used[$iusedindex][1] += 1
- $__g_audfids_usedds_used[$iusedindex][($nctrlid - 10000) + $_udf_gs_offset_offset] = $nctrlid
- Return $nctrlid
- EndFunc
- Func __udf_freeglobalid($hwnd, $iglobalid)
- If $iglobalid - $_udf_startid < 0 OR $iglobalid - $_udf_startid > $_udf_g_max_idsmax_ids Then Return SetError(-1, 0, False)
- For $iindex = 0 To $_udf_g_max_winmax_win - 1
- If $__g_audfids_usedds_used[$iindex][0] = $hwnd Then
- For $x = $_udf_gs_offset_offset To UBound($__g_audfids_usedds_used, $ubound_columns) - 1
- If $__g_audfids_usedds_used[$iindex][$x] = $iglobalid Then
- $__g_audfids_usedds_used[$iindex][$x] = 0
- Return True
- EndIf
- Next
- Return SetError(-3, 0, False)
- EndIf
- Next
- Return SetError(-2, 0, False)
- EndFunc
- Global $__g_hsblastwnd
- Global Const $__statusbarconlassnamlassname = "msctusbar32usbar32"
- Global Const $__statusbarc_wm_siz_wm_size = 5
- Global Const $__statusbarconst_defaul_default = -16777216
- Global Const $tagborders = "int BY;int RX;int RX"
- Func _guictrlstatusbar_create($hwnd, $vpartedge = -1, $vparttext = "", $istyles = -1, $iexstyles = -1)
- If NOT IsHWnd($hwnd) Then Return SetError(1, 0, 0)
- Local $istyle = BitOR($__udfguicows_chilws_child, $__udfguicons_visibl_visible)
- If $istyles = -1 Then $istyles = 0
- If $iexstyles = -1 Then $iexstyles = 0
- Local $apartwidth[1], $aparttext[1]
- If @NumParams > 1 Then
- If IsArray($vpartedge) Then
- $apartwidth = $vpartedge
- Else
- $apartwidth[0] = $vpartedge
- EndIf
- If @NumParams = 2 Then
- ReDim $aparttext[UBound($apartwidth)]
- Else
- If IsArray($vparttext) Then
- $aparttext = $vparttext
- Else
- $aparttext[0] = $vparttext
- EndIf
- If UBound($apartwidth) <> UBound($aparttext) Then
- Local $ilast
- If UBound($apartwidth) > UBound($aparttext) Then
- $ilast = UBound($aparttext)
- ReDim $aparttext[UBound($apartwidth)]
- For $x = $ilast To UBound($aparttext) - 1
- $apartwidth[$x] = ""
- Next
- Else
- $ilast = UBound($apartwidth)
- ReDim $apartwidth[UBound($aparttext)]
- For $x = $ilast To UBound($apartwidth) - 1
- $apartwidth[$x] = $apartwidth[$x - 1] + 75
- Next
- $apartwidth[UBound($aparttext) - 1] = -1
- EndIf
- EndIf
- EndIf
- If NOT IsHWnd($hwnd) Then $hwnd = HWnd($hwnd)
- If @NumParams > 3 Then $istyle = BitOR($istyle, $istyles)
- EndIf
- Local $nctrlid = __udf_getnextglobalid($hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Local $hwndsbar = _winapi_createwindowex($iexstyles, $__statusbarconlassnamlassname, "", $istyle, 0, 0, 0, 0, $hwnd, $nctrlid)
- If @error Then Return SetError(@error, @extended, 0)
- If @NumParams > 1 Then
- _guictrlstatusbar_setparts($hwndsbar, UBound($apartwidth), $apartwidth)
- For $x = 0 To UBound($aparttext) - 1
- _guictrlstatusbar_settext($hwndsbar, $aparttext[$x], $x)
- Next
- EndIf
- Return $hwndsbar
- EndFunc
- Func _guictrlstatusbar_destroy(ByRef $hwnd)
- If NOT _winapi_isclassname($hwnd, $__statusbarconlassnamlassname) Then Return SetError(2, 2, False)
- Local $idestroyed = 0
- If IsHWnd($hwnd) Then
- If _winapi_inprocess($hwnd, $__g_hsblastwnd) Then
- Local $nctrlid = _winapi_getdlgctrlid($hwnd)
- Local $hparent = _winapi_getparent($hwnd)
- $idestroyed = _winapi_destroywindow($hwnd)
- Local $iret = __udf_freeglobalid($hparent, $nctrlid)
- If NOT $iret Then
- EndIf
- Else
- Return SetError(1, 1, False)
- EndIf
- EndIf
- If $idestroyed Then $hwnd = 0
- Return $idestroyed <> 0
- EndFunc
- Func _guictrlstatusbar_embedcontrol($hwnd, $ipart, $hcontrol, $ifit = 4)
- Local $arect = _guictrlstatusbar_getrect($hwnd, $ipart)
- Local $ibarx = $arect[0]
- Local $ibary = $arect[1]
- Local $ibarw = $arect[2] - $ibarx
- Local $ibarh = $arect[3] - $ibary
- Local $iconx = $ibarx
- Local $icony = $ibary
- Local $iconw = _winapi_getwindowwidth($hcontrol)
- Local $iconh = _winapi_getwindowheight($hcontrol)
- If $iconw > $ibarw Then $iconw = $ibarw
- If $iconh > $ibarh Then $iconh = $ibarh
- Local $ipadx = ($ibarw - $iconw) / 2
- Local $ipady = ($ibarh - $iconh) / 2
- If $ipadx < 0 Then $ipadx = 0
- If $ipady < 0 Then $ipady = 0
- If BitAND($ifit, 1) = 1 Then $iconx = $ibarx + $ipadx
- If BitAND($ifit, 2) = 2 Then $icony = $ibary + $ipady
- If BitAND($ifit, 4) = 4 Then
- $ipadx = _guictrlstatusbar_getbordersrect($hwnd)
- $ipady = _guictrlstatusbar_getbordersvert($hwnd)
- $iconx = $ibarx
- If _guictrlstatusbar_issimple($hwnd) Then $iconx += $ipadx
- $icony = $ibary + $ipady
- $iconw = $ibarw - ($ipadx * 2)
- $iconh = $ibarh - ($ipady * 2)
- EndIf
- _winapi_setparent($hcontrol, $hwnd)
- _winapi_movewindow($hcontrol, $iconx, $icony, $iconw, $iconh)
- EndFunc
- Func _guictrlstatusbar_getborders($hwnd)
- Local $tborders = DllStructCreate($tagborders)
- Local $iret
- If _winapi_inprocess($hwnd, $__g_hsblastwnd) Then
- $iret = _sendmessage($hwnd, $sb_getborders, 0, $tborders, 0, "wparam", "struct*")
- Else
- Local $isize = DllStructGetSize($tborders)
- Local $tmemmap
- Local $pmemory = _meminit($hwnd, $isize, $tmemmap)
- $iret = _sendmessage($hwnd, $sb_getborders, 0, $pmemory, 0, "wparam", "ptr")
- _memread($tmemmap, $pmemory, $tborders, $isize)
- _memfree($tmemmap)
- EndIf
- Local $aborders[3]
- If $iret = 0 Then Return SetError(-1, -1, $aborders)
- $aborders[0] = DllStructGetData($tborders, "BX")
- $aborders[1] = DllStructGetData($tborders, "BY")
- $aborders[2] = DllStructGetData($tborders, "RX")
- Return $aborders
- EndFunc
- Func _guictrlstatusbar_getbordershorz($hwnd)
- Local $aborders = _guictrlstatusbar_getborders($hwnd)
- Return SetError(@error, @extended, $aborders[0])
- EndFunc
- Func _guictrlstatusbar_getbordersrect($hwnd)
- Local $aborders = _guictrlstatusbar_getborders($hwnd)
- Return SetError(@error, @extended, $aborders[2])
- EndFunc
- Func _guictrlstatusbar_getbordersvert($hwnd)
- Local $aborders = _guictrlstatusbar_getborders($hwnd)
- Return SetError(@error, @extended, $aborders[1])
- EndFunc
- Func _guictrlstatusbar_getcount($hwnd)
- Return _sendmessage($hwnd, $sb_getparts)
- EndFunc
- Func _guictrlstatusbar_getheight($hwnd)
- Local $trect = _guictrlstatusbar_getrectex($hwnd, 0)
- Return DllStructGetData($trect, "Bottom") - DllStructGetData($trect, "Top") - (_guictrlstatusbar_getbordersvert($hwnd) * 2)
- EndFunc
- Func _guictrlstatusbar_geticon($hwnd, $iindex = 0)
- Return _sendmessage($hwnd, $sb_geticon, $iindex, 0, 0, "wparam", "lparam", "handle")
- EndFunc
- Func _guictrlstatusbar_getparts($hwnd)
- Local $icount = _guictrlstatusbar_getcount($hwnd)
- Local $tparts = DllStructCreate("int[" & $icount & "]")
- Local $aparts[$icount + 1]
- If _winapi_inprocess($hwnd, $__g_hsblastwnd) Then
- $aparts[0] = _sendmessage($hwnd, $sb_getparts, $icount, $tparts, 0, "wparam", "struct*")
- Else
- Local $iparts = DllStructGetSize($tparts)
- Local $tmemmap
- Local $pmemory = _meminit($hwnd, $iparts, $tmemmap)
- $aparts[0] = _sendmessage($hwnd, $sb_getparts, $icount, $pmemory, 0, "wparam", "ptr")
- _memread($tmemmap, $pmemory, $tparts, $iparts)
- _memfree($tmemmap)
- EndIf
- For $ii = 1 To $icount
- $aparts[$ii] = DllStructGetData($tparts, 1, $ii)
- Next
- Return $aparts
- EndFunc
- Func _guictrlstatusbar_getrect($hwnd, $ipart)
- Local $trect = _guictrlstatusbar_getrectex($hwnd, $ipart)
- If @error Then Return SetError(@error, 0, 0)
- Local $arect[4]
- $arect[0] = DllStructGetData($trect, "Left")
- $arect[1] = DllStructGetData($trect, "Top")
- $arect[2] = DllStructGetData($trect, "Right")
- $arect[3] = DllStructGetData($trect, "Bottom")
- Return $arect
- EndFunc
- Func _guictrlstatusbar_getrectex($hwnd, $ipart)
- Local $trect = DllStructCreate($tagrect)
- Local $iret
- If _winapi_inprocess($hwnd, $__g_hsblastwnd) Then
- $iret = _sendmessage($hwnd, $sb_getrect, $ipart, $trect, 0, "wparam", "struct*")
- Else
- Local $irect = DllStructGetSize($trect)
- Local $tmemmap
- Local $pmemory = _meminit($hwnd, $irect, $tmemmap)
- $iret = _sendmessage($hwnd, $sb_getrect, $ipart, $pmemory, 0, "wparam", "ptr")
- _memread($tmemmap, $pmemory, $trect, $irect)
- _memfree($tmemmap)
- EndIf
- Return SetError($iret = 0, 0, $trect)
- EndFunc
- Func _guictrlstatusbar_gettext($hwnd, $ipart)
- Local $bunicode = _guictrlstatusbar_getunicodeformat($hwnd)
- Local $ibuffer = _guictrlstatusbar_gettextlength($hwnd, $ipart) + 1
- If $ibuffer = 1 Then Return SetError(1, 0, "")
- Local $tbuffer
- If $bunicode Then
- $tbuffer = DllStructCreate("wchar Text[" & $ibuffer & "]")
- $ibuffer *= 2
- Else
- $tbuffer = DllStructCreate("char Text[" & $ibuffer & "]")
- EndIf
- If _winapi_inprocess($hwnd, $__g_hsblastwnd) Then
- _sendmessage($hwnd, $sb_gettextw, $ipart, $tbuffer, 0, "wparam", "struct*")
- Else
- Local $tmemmap
- Local $pmemory = _meminit($hwnd, $ibuffer, $tmemmap)
- If $bunicode Then
- _sendmessage($hwnd, $sb_gettextw, $ipart, $pmemory, 0, "wparam", "ptr")
- Else
- _sendmessage($hwnd, $sb_gettext, $ipart, $pmemory, 0, "wparam", "ptr")
- EndIf
- _memread($tmemmap, $pmemory, $tbuffer, $ibuffer)
- _memfree($tmemmap)
- EndIf
- Return DllStructGetData($tbuffer, "Text")
- EndFunc
- Func _guictrlstatusbar_gettextflags($hwnd, $ipart)
- If _guictrlstatusbar_getunicodeformat($hwnd) Then
- Return _sendmessage($hwnd, $sbtlengthwlengthw, $ipart)
- Else
- Return _sendmessage($hwnd, $sb_gettextlength, $ipart)
- EndIf
- EndFunc
- Func _guictrlstatusbar_gettextlength($hwnd, $ipart)
- Return _winapi_loword(_guictrlstatusbar_gettextflags($hwnd, $ipart))
- EndFunc
- Func _guictrlstatusbar_gettextlengthex($hwnd, $ipart)
- Return _winapi_hiword(_guictrlstatusbar_gettextflags($hwnd, $ipart))
- EndFunc
- Func _guictrlstatusbar_gettiptext($hwnd, $ipart)
- Local $bunicode = _guictrlstatusbar_getunicodeformat($hwnd)
- Local $tbuffer
- If $bunicode Then
- $tbuffer = DllStructCreate("wchar Text[4096]")
- Else
- $tbuffer = DllStructCreate("char Text[4096]")
- EndIf
- If _winapi_inprocess($hwnd, $__g_hsblastwnd) Then
- _sendmessage($hwnd, $sb_gettiptextw, _winapi_makelong($ipart, 4096), $tbuffer, 0, "wparam", "struct*")
- Else
- Local $tmemmap
- Local $pmemory = _meminit($hwnd, 4096, $tmemmap)
- If $bunicode Then
- _sendmessage($hwnd, $sb_gettiptextw, _winapi_makelong($ipart, 4096), $pmemory, 0, "wparam", "ptr")
- Else
- _sendmessage($hwnd, $sb_gettiptexta, _winapi_makelong($ipart, 4096), $pmemory, 0, "wparam", "ptr")
- EndIf
- _memread($tmemmap, $pmemory, $tbuffer, 4096)
- _memfree($tmemmap)
- EndIf
- Return DllStructGetData($tbuffer, "Text")
- EndFunc
- Func _guictrlstatusbar_getunicodeformat($hwnd)
- Return _sendmessage($hwnd, $sb_gdeformateformat) <> 0
- EndFunc
- Func _guictrlstatusbar_getwidth($hwnd, $ipart)
- Local $trect = _guictrlstatusbar_getrectex($hwnd, $ipart)
- Return DllStructGetData($trect, "Right") - DllStructGetData($trect, "Left") - (_guictrlstatusbar_getbordershorz($hwnd) * 2)
- EndFunc
- Func _guictrlstatusbar_issimple($hwnd)
- Return _sendmessage($hwnd, $sb_issimple) <> 0
- EndFunc
- Func _guictrlstatusbar_resize($hwnd)
- _sendmessage($hwnd, $__statusbarc_wm_siz_wm_size)
- EndFunc
- Func _guictrlstatusbar_setbkcolor($hwnd, $icolor)
- $icolor = _sendmessage($hwnd, $sb_setbkcolor, 0, $icolor)
- If $icolor = $__statusbarconst_defaul_default Then Return "0x" & Hex($__statusbarconst_defaul_default)
- Return $icolor
- EndFunc
- Func _guictrlstatusbar_seticon($hwnd, $ipart, $hicon = -1, $siconfile = "")
- If $hicon = -1 Then Return _sendmessage($hwnd, $sb_seticon, $ipart, $hicon, 0, "wparam", "handle") <> 0
- If StringLen($siconfile) <= 0 Then Return _sendmessage($hwnd, $sb_seticon, $ipart, $hicon) <> 0
- Local $ticon = DllStructCreate("handle")
- Local $vresult = DllCall("shell32.dll", "uint", "ExtractIconExW", "wstr", $siconfile, "int", $hicon, "ptr", 0, "struct*", $ticon, "uint", 1)
- If @error Then Return SetError(@error, @extended, False)
- $vresult = $vresult[0]
- If $vresult > 0 Then $vresult = _sendmessage($hwnd, $sb_seticon, $ipart, DllStructGetData($ticon, 1), 0, "wparam", "handle")
- DllCall("user32.dll", "bool", "DestroyIcon", "handle", DllStructGetData($ticon, 1))
- Return $vresult
- EndFunc
- Func _guictrlstatusbar_setminheight($hwnd, $iminheight)
- _sendmessage($hwnd, $sb_setminheight, $iminheight)
- _guictrlstatusbar_resize($hwnd)
- EndFunc
- Func _guictrlstatusbar_setparts($hwnd, $aparts = -1, $apartwidth = 25)
- Local $tparts, $iparts = 1
- If IsArray($aparts) <> 0 Then
- $aparts[UBound($aparts) - 1] = -1
- $iparts = UBound($aparts)
- $tparts = DllStructCreate("int[" & $iparts & "]")
- For $x = 0 To $iparts - 2
- DllStructSetData($tparts, 1, $aparts[$x], $x + 1)
- Next
- DllStructSetData($tparts, 1, -1, $iparts)
- ElseIf IsArray($apartwidth) <> 0 Then
- $iparts = UBound($apartwidth)
- $tparts = DllStructCreate("int[" & $iparts & "]")
- For $x = 0 To $iparts - 2
- DllStructSetData($tparts, 1, $apartwidth[$x], $x + 1)
- Next
- DllStructSetData($tparts, 1, -1, $iparts)
- ElseIf $aparts > 1 Then
- $iparts = $aparts
- $tparts = DllStructCreate("int[" & $iparts & "]")
- For $x = 1 To $iparts - 1
- DllStructSetData($tparts, 1, $apartwidth * $x, $x)
- Next
- DllStructSetData($tparts, 1, -1, $iparts)
- Else
- $tparts = DllStructCreate("int")
- DllStructSetData($tparts, $iparts, -1)
- EndIf
- If _winapi_inprocess($hwnd, $__g_hsblastwnd) Then
- _sendmessage($hwnd, $sb_setparts, $iparts, $tparts, 0, "wparam", "struct*")
- Else
- Local $isize = DllStructGetSize($tparts)
- Local $tmemmap
- Local $pmemory = _meminit($hwnd, $isize, $tmemmap)
- _memwrite($tmemmap, $tparts)
- _sendmessage($hwnd, $sb_setparts, $iparts, $pmemory, 0, "wparam", "ptr")
- _memfree($tmemmap)
- EndIf
- _guictrlstatusbar_resize($hwnd)
- Return True
- EndFunc
- Func _guictrlstatusbar_setsimple($hwnd, $bsimple = True)
- _sendmessage($hwnd, $sb_simple, $bsimple)
- EndFunc
- Func _guictrlstatusbar_settext($hwnd, $stext = "", $ipart = 0, $iuflag = 0)
- Local $bunicode = _guictrlstatusbar_getunicodeformat($hwnd)
- Local $ibuffer = StringLen($stext) + 1
- Local $ttext
- If $bunicode Then
- $ttext = DllStructCreate("wchar Text[" & $ibuffer & "]")
- $ibuffer *= 2
- Else
- $ttext = DllStructCreate("char Text[" & $ibuffer & "]")
- EndIf
- DllStructSetData($ttext, "Text", $stext)
- If _guictrlstatusbar_issimple($hwnd) Then $ipart = $sb_simpleid
- Local $iret
- If _winapi_inprocess($hwnd, $__g_hsblastwnd) Then
- $iret = _sendmessage($hwnd, $sb_settextw, BitOR($ipart, $iuflag), $ttext, 0, "wparam", "struct*")
- Else
- Local $tmemmap
- Local $pmemory = _meminit($hwnd, $ibuffer, $tmemmap)
- _memwrite($tmemmap, $ttext)
- If $bunicode Then
- $iret = _sendmessage($hwnd, $sb_settextw, BitOR($ipart, $iuflag), $pmemory, 0, "wparam", "ptr")
- Else
- $iret = _sendmessage($hwnd, $sb_settext, BitOR($ipart, $iuflag), $pmemory, 0, "wparam", "ptr")
- EndIf
- _memfree($tmemmap)
- EndIf
- Return $iret <> 0
- EndFunc
- Func _guictrlstatusbar_settiptext($hwnd, $ipart, $stext)
- Local $bunicode = _guictrlstatusbar_getunicodeformat($hwnd)
- Local $ibuffer = StringLen($stext) + 1
- Local $ttext
- If $bunicode Then
- $ttext = DllStructCreate("wchar TipText[" & $ibuffer & "]")
- $ibuffer *= 2
- Else
- $ttext = DllStructCreate("char TipText[" & $ibuffer & "]")
- EndIf
- DllStructSetData($ttext, "TipText", $stext)
- If _winapi_inprocess($hwnd, $__g_hsblastwnd) Then
- _sendmessage($hwnd, $sb_settiptextw, $ipart, $ttext, 0, "wparam", "struct*")
- Else
- Local $tmemmap
- Local $pmemory = _meminit($hwnd, $ibuffer, $tmemmap)
- _memwrite($tmemmap, $ttext, $pmemory, $ibuffer)
- If $bunicode Then
- _sendmessage($hwnd, $sb_settiptextw, $ipart, $pmemory, 0, "wparam", "ptr")
- Else
- _sendmessage($hwnd, $sb_settiptexta, $ipart, $pmemory, 0, "wparam", "ptr")
- EndIf
- _memfree($tmemmap)
- EndIf
- EndFunc
- Func _guictrlstatusbar_setunicodeformat($hwnd, $bunicode = True)
- Return _sendmessage($hwnd, $sb_sdeformateformat, $bunicode)
- EndFunc
- Func _guictrlstatusbar_showhide($hwnd, $istate)
- If $istate <> @SW_HIDE AND $istate <> @SW_SHOW Then Return SetError(1, 1, False)
- Return _winapi_showwindow($hwnd, $istate)
- EndFunc
- Global Const $ttf_idishwnd = 1
- Global Const $ttf_centertip = 2
- Global Const $ttf_rtlreading = 4
- Global Const $ttf_subclass = 16
- Global Const $ttf_track = 32
- Global Const $ttf_absolute = 128
- Global Const $ttf_transparent = 256
- Global Const $ttf_parselinks = 4096
- Global Const $ttf_di_setitem = 32768
- Global Const $__tooltipco_wm_use_wm_user = 1024
- Global Const $ttm_activate = $__tooltipco_wm_use_wm_user + 1
- Global Const $ttm_setdelaytime = $__tooltipco_wm_use_wm_user + 3
- Global Const $ttm_addtool = $__tooltipco_wm_use_wm_user + 4
- Global Const $ttm_deltool = $__tooltipco_wm_use_wm_user + 5
- Global Const $ttm_newtoolrect = $__tooltipco_wm_use_wm_user + 6
- Global Const $ttm_gettoolinfo = $__tooltipco_wm_use_wm_user + 8
- Global Const $ttm_settoolinfo = $__tooltipco_wm_use_wm_user + 9
- Global Const $ttm_hittest = $__tooltipco_wm_use_wm_user + 10
- Global Const $ttm_gettext = $__tooltipco_wm_use_wm_user + 11
- Global Const $ttetiptexttiptext = $__tooltipco_wm_use_wm_user + 12
- Global Const $ttm_gettoolcount = $__tooltipco_wm_use_wm_user + 13
- Global Const $ttm_enumtools = $__tooltipco_wm_use_wm_user + 14
- Global Const $ttmrenttoolenttool = $__tooltipco_wm_use_wm_user + 15
- Global Const $ttm_rompointompoint = $__tooltipco_wm_use_wm_user + 16
- Global Const $ttactivatectivate = $__tooltipco_wm_use_wm_user + 17
- Global Const $ttpositionosition = $__tooltipco_wm_use_wm_user + 18
- Global Const $ttpbkcolorbkcolor = $__tooltipco_wm_use_wm_user + 19
- Global Const $ttm_extcolorxtcolor = $__tooltipco_wm_use_wm_user + 20
- Global Const $ttm_getdelaytime = $__tooltipco_wm_use_wm_user + 21
- Global Const $ttpbkcolorbkcolor = $__tooltipco_wm_use_wm_user + 22
- Global Const $ttm_extcolorxtcolor = $__tooltipco_wm_use_wm_user + 23
- Global Const $ttmtipwidthipwidth = $__tooltipco_wm_use_wm_user + 24
- Global Const $ttmtipwidthipwidth = $__tooltipco_wm_use_wm_user + 25
- Global Const $ttm_setmargin = $__tooltipco_wm_use_wm_user + 26
- Global Const $ttm_getmargin = $__tooltipco_wm_use_wm_user + 27
- Global Const $ttm_pop = $__tooltipco_wm_use_wm_user + 28
- Global Const $ttm_update = $__tooltipco_wm_use_wm_user + 29
- Global Const $ttbblesizeblesize = $__tooltipco_wm_use_wm_user + 30
- Global Const $ttm_adjustrect = $__tooltipco_wm_use_wm_user + 31
- Global Const $ttm_settitle = $__tooltipco_wm_use_wm_user + 32
- Global Const $ttm_settitlew = $__tooltipco_wm_use_wm_user + 33
- Global Const $ttm_popup = $__tooltipco_wm_use_wm_user + 34
- Global Const $ttm_gettitle = $__tooltipco_wm_use_wm_user + 35
- Global Const $ttm_addtoolw = $__tooltipco_wm_use_wm_user + 50
- Global Const $ttm_deltoolw = $__tooltipco_wm_use_wm_user + 51
- Global Const $ttm_newtoolrectw = $__tooltipco_wm_use_wm_user + 52
- Global Const $ttm_gettoolinfow = $__tooltipco_wm_use_wm_user + 53
- Global Const $ttm_settoolinfow = $__tooltipco_wm_use_wm_user + 54
- Global Const $ttm_hittestw = $__tooltipco_wm_use_wm_user + 55
- Global Const $ttm_gettextw = $__tooltipco_wm_use_wm_user + 56
- Global Const $ttmtiptextwiptextw = $__tooltipco_wm_use_wm_user + 57
- Global Const $ttm_enumtoolsw = $__tooltipco_wm_use_wm_user + 58
- Global Const $ttm_enttoolwnttoolw = $__tooltipco_wm_use_wm_user + 59
- Global Const $ttmdowthemeowtheme = 8192 + 11
- Global Const $ttn_first = -520
- Global Const $ttn_getdispinfo = $ttn_first + 0
- Global Const $ttn_show = $ttn_first - 1
- Global Const $ttn_pop = $ttn_first - 2
- Global Const $ttn_linkclick = $ttn_first - 3
- Global Const $ttn_getdispinfow = $ttn_first - 10
- Global Const $tts_alwaystip = 1
- Global Const $tts_noprefix = 2
- Global Const $tts_noanimate = 16
- Global Const $tts_nofade = 32
- Global Const $tts_balloon = 64
- Global Const $tts_close = 128
- Global Const $ttsualstylealstyle = 256
- Global Const $ttdt_automatic = 0
- Global Const $ttdt_reshow = 1
- Global Const $ttdt_autopop = 2
- Global Const $ttdt_initial = 3
- Global Enum $tti_none, $tti_info, $tti_warning, $tti_error, $tti_info_large, $ttng_largeg_large, $tti_error_large
- Global $__g_heditlastwnd
- Global Const $__editconlassnamlassname = "Edit"
- Global Const $__editconst_checke_checked = 1
- Global Const $__editcogui_hideui_hide = 32
- Global Const $__editconstant_nt_closnt_close = -3
- Global Const $__editconsi_enabli_enable = 64
- Global Const $__editconst_disabl_disable = 128
- Global Const $__editcons_centes_center = 1
- Global Const $__editconstaetredraetredraw = 11
- Global Const $__editcons_captio_caption = 12582912
- Global Const $__editcows_popups_popup = -2147483648
- Global Const $__editcons_sysmen_sysmenu = 524288
- Global Const $__editconstantimizeboimizebox = 131072
- Global Const $__editconstant_dgui_fongui_font = 17
- Global Const $__editcons_setfon_setfont = 48
- Global Const $__editconstant_wxtlengtxtlength = 14
- Global Const $__editcons_gettex_gettext = 13
- Global Const $__editcons_settex_settext = 12
- Global Const $__editconb_lineub_lineup = 0
- Global Const $__editconstlinedowlinedown = 1
- Global Const $__editconstpagedowpagedown = 3
- Global Const $__editconb_pageub_pageup = 2
- Global Const $__editconstantollcareollcaret = 4
- Global Const $__talloontiploontip = "dword r Te;ptr tint Icoint Iconnt Icon"
- Func _guictrledit_appendtext($hwnd, $stext)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Local $ilength = _guictrledit_gettextlen($hwnd)
- _guictrledit_setsel($hwnd, $ilength, $ilength)
- _sendmessage($hwnd, $em_replacesel, True, $stext, 0, "wparam", "wstr")
- EndFunc
- Func _guictrledit_beginupdate($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $__editconstaetredraetredraw, False) = 0
- EndFunc
- Func _guictrledit_canundo($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_canundo) <> 0
- EndFunc
- Func _guictrledit_charfrompos($hwnd, $ix, $iy)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Local $areturn[2]
- Local $iret = _sendmessage($hwnd, $em_charfrompos, 0, _winapi_makelong($ix, $iy))
- $areturn[0] = _winapi_loword($iret)
- $areturn[1] = _winapi_hiword($iret)
- Return $areturn
- EndFunc
- Func _guictrledit_create($hwnd, $stext, $ix, $iy, $iwidth = 150, $iheight = 150, $istyle = 3150020, $iexstyle = 512)
- If NOT IsHWnd($hwnd) Then Return SetError(1, 0, 0)
- If NOT IsString($stext) Then Return SetError(2, 0, 0)
- If $iwidth = -1 Then $iwidth = 150
- If $iheight = -1 Then $iheight = 150
- If $istyle = -1 Then $istyle = 3150020
- If $iexstyle = -1 Then $iexstyle = 512
- If BitAND($istyle, $es_readonly) = $es_readonly Then
- $istyle = BitOR($__udfguicows_chilws_child, $__udfguicons_visibl_visible, $istyle)
- Else
- $istyle = BitOR($__udfguicows_chilws_child, $__udfguicons_visibl_visible, $__udfguicons_tabsto_tabstop, $istyle)
- EndIf
- Local $nctrlid = __udf_getnextglobalid($hwnd)
- If @error Then Return SetError(@error, @extended, 0)
- Local $hedit = _winapi_createwindowex($iexstyle, $__editconlassnamlassname, "", $istyle, $ix, $iy, $iwidth, $iheight, $hwnd, $nctrlid)
- _sendmessage($hedit, $__editcons_setfon_setfont, _winapi_getstockobject($__editconstant_dgui_fongui_font), True)
- _guictrledit_settext($hedit, $stext)
- _guictrledit_setlimittext($hedit, 0)
- Return $hedit
- EndFunc
- Func _guictrledit_destroy(ByRef $hwnd)
- If NOT _winapi_isclassname($hwnd, $__editconlassnamlassname) Then Return SetError(2, 2, False)
- Local $idestroyed = 0
- If IsHWnd($hwnd) Then
- If _winapi_inprocess($hwnd, $__g_heditlastwnd) Then
- Local $nctrlid = _winapi_getdlgctrlid($hwnd)
- Local $hparent = _winapi_getparent($hwnd)
- $idestroyed = _winapi_destroywindow($hwnd)
- Local $iret = __udf_freeglobalid($hparent, $nctrlid)
- If NOT $iret Then
- EndIf
- Else
- Return SetError(1, 1, False)
- EndIf
- Else
- $idestroyed = GUICtrlDelete($hwnd)
- EndIf
- If $idestroyed Then $hwnd = 0
- Return $idestroyed <> 0
- EndFunc
- Func _guictrledit_emptyundobuffer($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- _sendmessage($hwnd, $em_dobufferobuffer)
- EndFunc
- Func _guictrledit_endupdate($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $__editconstaetredraetredraw, True) = 0
- EndFunc
- Func _guictrledit_fmtlines($hwnd, $bsoftbreak = False)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_fmtlines, $bsoftbreak)
- EndFunc
- Func _guictrledit_find($hwnd, $breplace = False)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Local $ipos = 0, $icase, $ioccurance = 0, $ireplacements = 0
- Local $apartsrightedge[3] = [125, 225, -1]
- Local $ioldmode = Opt("GUIOnEventMode", 0)
- Local $asel = _guictrledit_getsel($hwnd)
- Local $stext = _guictrledit_gettext($hwnd)
- Local $hguisearch = GUICreate("Find", 349, 177, -1, -1, BitOR($__udfguicows_chilws_child, $__editconstantimizeboimizebox, $__editcons_captio_caption, $__editcows_popups_popup, $__editcons_sysmen_sysmenu))
- Local $idstatusbar1 = _guictrlstatusbar_create($hguisearch, $apartsrightedge)
- _guictrlstatusbar_settext($idstatusbar1, "Find: ")
- GUISetIcon(@SystemDir & "\shell32.dll", 22, $hguisearch)
- GUICtrlCreateLabel("Find what:", 9, 10, 53, 16, $__editcons_centes_center)
- Local $idinputsearch = GUICtrlCreateInput("", 80, 8, 257, 21)
- Local $idlblreplace = GUICtrlCreateLabel("Replace with:", 9, 42, 69, 17, $__editcons_centes_center)
- Local $idinputreplace = GUICtrlCreateInput("", 80, 40, 257, 21)
- Local $idchkwholeonly = GUICtrlCreateCheckbox("Match ord onlyrd only", 9, 72, 145, 17)
- Local $idchkmatchcase = GUICtrlCreateCheckbox("Match case", 9, 96, 145, 17)
- Local $idbtnfindnext = GUICtrlCreateButton("Find Next", 168, 72, 161, 21, 0)
- Local $idbtnreplace = GUICtrlCreateButton("Replace", 168, 96, 161, 21, 0)
- Local $idbtnclose = GUICtrlCreateButton("Close", 104, 130, 161, 21, 0)
- If (IsArray($asel) AND $asel <> $ec_err) Then
- GUICtrlSetData($idinputsearch, StringMid($stext, $asel[0] + 1, $asel[1] - $asel[0]))
- If $asel[0] <> $asel[1] Then
- $ipos = $asel[0]
- If BitAND(GUICtrlRead($idchkmatchcase), $__editconst_checke_checked) = $__editconst_checke_checked Then $icase = 1
- $ioccurance = 1
- Local $itpose
- While 1
- $itpose = StringInStr($stext, GUICtrlRead($idinputsearch), $icase, $ioccurance)
- If NOT $itpose Then
- $ioccurance = 0
- ExitLoop
- ElseIf $itpose = $ipos + 1 Then
- ExitLoop
- EndIf
- $ioccurance += 1
- WEnd
- EndIf
- _guictrlstatusbar_settext($idstatusbar1, "Find: " & GUICtrlRead($idinputsearch))
- EndIf
- If $breplace = False Then
- GUICtrlSetState($idlblreplace, $__editcogui_hideui_hide)
- GUICtrlSetState($idinputreplace, $__editcogui_hideui_hide)
- GUICtrlSetState($idbtnreplace, $__editcogui_hideui_hide)
- Else
- _guictrlstatusbar_settext($idstatusbar1, "Replacements: " & $ireplacements, 1)
- _guictrlstatusbar_settext($idstatusbar1, "With: ", 2)
- EndIf
- GUISetState(@SW_SHOW)
- Local $imsgfind
- While 1
- $imsgfind = GUIGetMsg()
- Select
- Case $imsgfind = $__editconstant_nt_closnt_close OR $imsgfind = $idbtnclose
- ExitLoop
- Case $imsgfind = $idbtnfindnext
- GUICtrlSetState($idbtnfindnext, $__editconst_disabl_disable)
- GUICtrlSetCursor($idbtnfindnext, 15)
- Sleep(100)
- _guictrlstatusbar_settext($idstatusbar1, "Find: " & GUICtrlRead($idinputsearch))
- If $breplace = True Then
- _guictrlstatusbar_settext($idstatusbar1, "Find: " & GUICtrlRead($idinputsearch))
- _guictrlstatusbar_settext($idstatusbar1, "With: " & GUICtrlRead($idinputreplace), 2)
- EndIf
- __guictrledit_findtext($hwnd, $idinputsearch, $idchkmatchcase, $idchkwholeonly, $ipos, $ioccurance, $ireplacements)
- Sleep(100)
- GUICtrlSetState($idbtnfindnext, $__editconsi_enabli_enable)
- GUICtrlSetCursor($idbtnfindnext, 2)
- Case $imsgfind = $idbtnreplace
- GUICtrlSetState($idbtnreplace, $__editconst_disabl_disable)
- GUICtrlSetCursor($idbtnreplace, 15)
- Sleep(100)
- _guictrlstatusbar_settext($idstatusbar1, "Find: " & GUICtrlRead($idinputsearch))
- _guictrlstatusbar_settext($idstatusbar1, "With: " & GUICtrlRead($idinputreplace), 2)
- If $ipos Then
- _guictrledit_replacesel($hwnd, GUICtrlRead($idinputreplace))
- $ireplacements += 1
- $ioccurance -= 1
- _guictrlstatusbar_settext($idstatusbar1, "Replacements: " & $ireplacements, 1)
- EndIf
- __guictrledit_findtext($hwnd, $idinputsearch, $idchkmatchcase, $idchkwholeonly, $ipos, $ioccurance, $ireplacements)
- Sleep(100)
- GUICtrlSetState($idbtnreplace, $__editconsi_enabli_enable)
- GUICtrlSetCursor($idbtnreplace, 2)
- EndSelect
- WEnd
- GUIDelete($hguisearch)
- Opt("GUIOnEventMode", $ioldmode)
- EndFunc
- Func __guictrledit_findtext($hwnd, $idinputsearch, $idchkmatchcase, $idchkwholeonly, ByRef $ipos, ByRef $ioccurance, ByRef $ireplacements)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Local $icase = 0, $iwhole = 0
- Local $bexact = False
- Local $sfind = GUICtrlRead($idinputsearch)
- Local $stext = _guictrledit_gettext($hwnd)
- If BitAND(GUICtrlRead($idchkmatchcase), $__editconst_checke_checked) = $__editconst_checke_checked Then $icase = 1
- If BitAND(GUICtrlRead($idchkwholeonly), $__editconst_checke_checked) = $__editconst_checke_checked Then $iwhole = 1
- If $sfind <> "" Then
- $ioccurance += 1
- $ipos = StringInStr($stext, $sfind, $icase, $ioccurance)
- If $iwhole AND $ipos Then
- Local $s_compare2 = StringMid($stext, $ipos + StringLen($sfind), 1)
- If $ipos = 1 Then
- If ($ipos + StringLen($sfind)) - 1 = StringLen($stext) OR ($s_compare2 = " " OR $s_compare2 = @LF OR $s_compare2 = @CR OR $s_compare2 = @CRLF OR $s_compare2 = @TAB) Then $bexact = True
- Else
- Local $s_compare1 = StringMid($stext, $ipos - 1, 1)
- If ($ipos + StringLen($sfind)) - 1 = StringLen($stext) Then
- If ($s_compare1 = " " OR $s_compare1 = @LF OR $s_compare1 = @CR OR $s_compare1 = @CRLF OR $s_compare1 = @TAB) Then $bexact = True
- Else
- If ($s_compare1 = " " OR $s_compare1 = @LF OR $s_compare1 = @CR OR $s_compare1 = @CRLF OR $s_compare1 = @TAB) AND ($s_compare2 = " " OR $s_compare2 = @LF OR $s_compare2 = @CR OR $s_compare2 = @CRLF OR $s_compare2 = @TAB) Then $bexact = True
- EndIf
- EndIf
- If $bexact = False Then
- __guictrledit_findtext($hwnd, $idinputsearch, $idchkmatchcase, $idchkwholeonly, $ipos, $ioccurance, $ireplacements)
- Else
- _guictrledit_setsel($hwnd, $ipos - 1, ($ipos + StringLen($sfind)) - 1)
- _guictrledit_scroll($hwnd, $__editconstantollcareollcaret)
- EndIf
- ElseIf $iwhole AND NOT $ipos Then
- $ioccurance = 0
- MsgBox($mb_systemmodal, "Find", "Reached End of document, Caistringistring string '" & $sfind & "'")
- ElseIf NOT $iwhole Then
- If NOT $ipos Then
- $ioccurance = 1
- _guictrledit_setsel($hwnd, -1, 0)
- _guictrledit_scroll($hwnd, $__editconstantollcareollcaret)
- $ipos = StringInStr($stext, $sfind, $icase, $ioccurance)
- If NOT $ipos Then
- $ioccurance = 0
- MsgBox($mb_systemmodal, "Find", "Reached End of document, Canntring ntring tring '" & $sfind & "'")
- Else
- _guictrledit_setsel($hwnd, $ipos - 1, ($ipos + StringLen($sfind)) - 1)
- _guictrledit_scroll($hwnd, $__editconstantollcareollcaret)
- EndIf
- Else
- _guictrledit_setsel($hwnd, $ipos - 1, ($ipos + StringLen($sfind)) - 1)
- _guictrledit_scroll($hwnd, $__editconstantollcareollcaret)
- EndIf
- EndIf
- EndIf
- EndFunc
- Func _guictrledit_getfirstvisibleline($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_getfiblelinebleline)
- EndFunc
- Func _guictrledit_gethandle($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return Ptr(_sendmessage($hwnd, $em_gethandle))
- EndFunc
- Func _guictrledit_getimestatus($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_getimestatus, $emsis_coonstringnstring)
- EndFunc
- Func _guictrledit_getlimittext($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_getlimittext)
- EndFunc
- Func _guictrledit_getline($hwnd, $iline)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Local $ilength = _guictrledit_linelength($hwnd, $iline)
- If $ilength = 0 Then Return ""
- Local $tbuffer = DllStructCreate("short ar Text[r Text[" & $ilength & "]")
- DllStructSetData($tbuffer, "Len", $ilength + 1)
- Local $iret = _sendmessage($hwnd, $em_getline, $iline, $tbuffer, 0, "wparam", "struct*")
- If $iret = 0 Then Return SetError($ec_err, $ec_err, "")
- Local $ttext = DllStructCreate("wchar Text[" & $ilength & "]", DllStructGetPtr($tbuffer))
- Return DllStructGetData($ttext, "Text")
- EndFunc
- Func _guictrledit_getlinecount($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_getlinecount)
- EndFunc
- Func _guictrledit_getmargins($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Local $amargins[2]
- Local $imargins = _sendmessage($hwnd, $em_getmargins)
- $amargins[0] = _winapi_loword($imargins)
- $amargins[1] = _winapi_hiword($imargins)
- Return $amargins
- EndFunc
- Func _guictrledit_getmodify($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_getmodify) <> 0
- EndFunc
- Func _guictrledit_getpasswordchar($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_wordcharordchar)
- EndFunc
- Func _guictrledit_getrect($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Local $arect[4]
- Local $trect = _guictrledit_getrectex($hwnd)
- $arect[0] = DllStructGetData($trect, "Left")
- $arect[1] = DllStructGetData($trect, "Top")
- $arect[2] = DllStructGetData($trect, "Right")
- $arect[3] = DllStructGetData($trect, "Bottom")
- Return $arect
- EndFunc
- Func _guictrledit_getrectex($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Local $trect = DllStructCreate($tagrect)
- _sendmessage($hwnd, $em_getrect, 0, $trect, 0, "wparam", "struct*")
- Return $trect
- EndFunc
- Func _guictrledit_getsel($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Local $asel[2]
- Local $tstart = DllStructCreate("uint Start")
- Local $tend = DllStructCreate("uint End")
- _sendmessage($hwnd, $em_getsel, $tstart, $tend, 0, "struct*", "struct*")
- $asel[0] = DllStructGetData($tstart, "Start")
- $asel[1] = DllStructGetData($tend, "End")
- Return $asel
- EndFunc
- Func _guictrledit_gettext($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Local $itextlen = _guictrledit_gettextlen($hwnd) + 1
- Local $ttext = DllStructCreate("wchar Text[" & $itextlen & "]")
- _sendmessage($hwnd, $__editcons_gettex_gettext, $itextlen, $ttext, 0, "wparam", "struct*")
- Return DllStructGetData($ttext, "Text")
- EndFunc
- Func _guictrledit_gettextlen($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $__editconstant_wxtlengtxtlength)
- EndFunc
- Func _guictrledit_getthumb($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_getthumb)
- EndFunc
- Func _guictrledit_getwordbreakproc($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_greakproceakproc)
- EndFunc
- Func _guictrledit_hideballoontip($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $emlloontiploontip) <> 0
- EndFunc
- Func _guictrledit_inserttext($hwnd, $stext, $iindex = -1)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- If $iindex = -1 Then
- _guictrledit_appendtext($hwnd, $stext)
- Else
- _guictrledit_setsel($hwnd, $iindex, $iindex)
- _sendmessage($hwnd, $em_replacesel, True, $stext, 0, "wparam", "wstr")
- EndIf
- EndFunc
- Func _guictrledit_linefromchar($hwnd, $iindex = -1)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_linefromchar, $iindex)
- EndFunc
- Func _guictrledit_lineindex($hwnd, $iindex = -1)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_lineindex, $iindex)
- EndFunc
- Func _guictrledit_linelength($hwnd, $iindex = -1)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Local $icharindex = _guictrledit_lineindex($hwnd, $iindex)
- Return _sendmessage($hwnd, $em_linelength, $icharindex)
- EndFunc
- Func _guictrledit_linescroll($hwnd, $ihoriz, $ivert)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_linescroll, $ihoriz, $ivert) <> 0
- EndFunc
- Func _guictrledit_posfromchar($hwnd, $iindex)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Local $acoord[2]
- Local $iret = _sendmessage($hwnd, $em_posfromchar, $iindex)
- $acoord[0] = _winapi_loword($iret)
- $acoord[1] = _winapi_hiword($iret)
- Return $acoord
- EndFunc
- Func _guictrledit_replacesel($hwnd, $stext, $bundo = True)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- _sendmessage($hwnd, $em_replacesel, $bundo, $stext, 0, "wparam", "wstr")
- EndFunc
- Func _guictrledit_scroll($hwnd, $idirection)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- If BitAND($idirection, $__editconstlinedowlinedown) <> $__editconstlinedowlinedown AND BitAND($idirection, $__editconb_lineub_lineup) <> $__editconb_lineub_lineup AND BitAND($idirection, $__editconstpagedowpagedown) <> $__editconstpagedowpagedown AND BitAND($idirection, $__editconb_pageub_pageup) <> $__editconb_pageub_pageup AND BitAND($idirection, $__editconstantollcareollcaret) <> $__editconstantollcareollcaret Then Return 0
- If $idirection == $__editconstantollcareollcaret Then
- Return _sendmessage($hwnd, $em_scrollcaret)
- Else
- Return _sendmessage($hwnd, $em_scroll, $idirection)
- EndIf
- EndFunc
- Func _guictrledit_sethandle($hwnd, $hmemory)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- _sendmessage($hwnd, $em_sethandle, $hmemory, 0, 0, "handle")
- EndFunc
- Func _guictrledit_setimestatus($hwnd, $icomposition)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_setimestatus, $emsis_coonstringnstring, $icomposition)
- EndFunc
- Func _guictrledit_setlimittext($hwnd, $ilimit)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- _sendmessage($hwnd, $em_setlimittext, $ilimit)
- EndFunc
- Func _guictrledit_setmargins($hwnd, $imargin = 1, $ileft = 65535, $iright = 65535)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- _sendmessage($hwnd, $em_setmargins, $imargin, _winapi_makelong($ileft, $iright))
- EndFunc
- Func _guictrledit_setmodify($hwnd, $bmodified)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- _sendmessage($hwnd, $em_setmodify, $bmodified)
- EndFunc
- Func _guictrledit_setpasswordchar($hwnd, $sdisplaychar = "0")
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- $sdisplaychar = StringLeft($sdisplaychar, 1)
- If Asc($sdisplaychar) = 48 Then
- _sendmessage($hwnd, $em_wordcharordchar)
- Else
- _sendmessage($hwnd, $em_wordcharordchar, Asc($sdisplaychar))
- EndIf
- EndFunc
- Func _guictrledit_setreadonly($hwnd, $breadonly)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_setreadonly, $breadonly) <> 0
- EndFunc
- Func _guictrledit_setrect($hwnd, $arect)
- Local $trect = DllStructCreate($tagrect)
- DllStructSetData($trect, "Left", $arect[0])
- DllStructSetData($trect, "Top", $arect[1])
- DllStructSetData($trect, "Right", $arect[2])
- DllStructSetData($trect, "Bottom", $arect[3])
- _guictrledit_setrectex($hwnd, $trect)
- EndFunc
- Func _guictrledit_setrectex($hwnd, $trect)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- _sendmessage($hwnd, $em_setrect, 0, $trect, 0, "wparam", "struct*")
- EndFunc
- Func _guictrledit_setrectnp($hwnd, $arect)
- Local $trect = DllStructCreate($tagrect)
- DllStructSetData($trect, "Left", $arect[0])
- DllStructSetData($trect, "Top", $arect[1])
- DllStructSetData($trect, "Right", $arect[2])
- DllStructSetData($trect, "Bottom", $arect[3])
- _guictrledit_setrectnpex($hwnd, $trect)
- EndFunc
- Func _guictrledit_setrectnpex($hwnd, $trect)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- _sendmessage($hwnd, $em_setrectnp, 0, $trect, 0, "wparam", "struct*")
- EndFunc
- Func _guictrledit_setsel($hwnd, $istart, $iend)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- _sendmessage($hwnd, $em_setsel, $istart, $iend)
- EndFunc
- Func _guictrledit_settabstops($hwnd, $atabstops)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- If NOT IsArray($atabstops) Then Return SetError(-1, -1, False)
- Local $stabstops = ""
- Local $inumtabstops = UBound($atabstops)
- For $x = 0 To $inumtabstops - 1
- $stabstops &= "int;"
- Next
- $stabstops = StringTrimRight($stabstops, 1)
- Local $ttabstops = DllStructCreate($stabstops)
- For $x = 0 To $inumtabstops - 1
- DllStructSetData($ttabstops, $x + 1, $atabstops[$x])
- Next
- Local $iret = _sendmessage($hwnd, $em_settabstops, $inumtabstops, $ttabstops, 0, "wparam", "struct*") <> 0
- _winapi_invalidaterect($hwnd)
- Return $iret
- EndFunc
- Func _guictrledit_settext($hwnd, $stext)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- _sendmessage($hwnd, $__editcons_settex_settext, 0, $stext, 0, "wparam", "wstr")
- EndFunc
- Func _guictrledit_setwordbreakproc($hwnd, $iaddressfunc)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- _sendmessage($hwnd, $em_sreakproceakproc, 0, $iaddressfunc)
- EndFunc
- Func _guictrledit_showballoontip($hwnd, $stitle, $stext, $iicon)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Local $ttitle = _winapi_multibytetowidechar($stitle)
- Local $ttext = _winapi_multibytetowidechar($stext)
- Local $ttt = DllStructCreate($__talloontiploontip)
- DllStructSetData($ttt, "Size", DllStructGetSize($ttt))
- DllStructSetData($ttt, "Title", DllStructGetPtr($ttitle))
- DllStructSetData($ttt, "Text", DllStructGetPtr($ttext))
- DllStructSetData($ttt, "Icon", $iicon)
- Return _sendmessage($hwnd, $emlloontiploontip, 0, $ttt, 0, "wparam", "struct*") <> 0
- EndFunc
- Func _guictrledit_undo($hwnd)
- If NOT IsHWnd($hwnd) Then $hwnd = GUICtrlGetHandle($hwnd)
- Return _sendmessage($hwnd, $em_undo) <> 0
- EndFunc
- #RequireAdmin
- If @AutoItX64 Then
- MsgBox(16, "Error!", "Please run all bot-6) mode6) mode6) mode.")
- Exit
- EndIf
- #Region Declarations
- Local $mkernelhandle
- Local $mgwprochandle
- Local $mgwhwnd
- Local $mmemory
- Local $mlabels[1][2]
- Local $mbase = 14548992
- Local $masmstring, $masmsize, $masmcodeoffset
- Local $mgui = GUICreate("GWAІ"), $mskillactivate, $mskillcancel, $mskillcomplete, $mchatreceive, $mloadfinished
- Local $mskilllogstruct = DllStructCreate("dword;dwrd;floatd;float")
- Local $msktructptrructptr = DllStructGetPtr($mskilllogstruct)
- Local $mchatlogstruct = DllStructCreate("dword;wchar[256]")
- Local $mctructptrructptr = DllStructGetPtr($mchatlogstruct)
- GUIRegisterMsg(1281, "Event")
- Local $mqueuecounter, $mqueuesize, $mqueuebase
- Local $mtargetlogbase
- Local $mstringlogbase
- Local $mskillbase
- Local $mensureenglish
- Local $mmyid, $mcurrenttarget
- Local $magentbase
- Local $mbasepointer
- Local $mregion, $mlanguage
- Local $mping
- Local $mcharname
- Local $mmapid
- Local $mmaxagents
- Local $mmaploading
- Local $mmapisloaded
- Local $mloggedin
- Local $msndlerptrdlerptr
- Local $mwritechatsender
- Local $mtraderquoteid, $mtradercostid, $mtradercostvalue
- Local $mskilltimer
- Local $mbuildnumber
- Local $mzoomstill, $mzoommoving
- Local $mdenderingndering
- Local $magentcopycount
- Local $magentcopybase
- Local $musestringlog
- Local $museeventsystem
- #EndRegion Declarations
- #Region CommandStructs
- Local $museskill = DllStructCreate("ptr;dwrd;dwordd;dword")
- Local $museskillptr = DllStructGetPtr($museskill)
- Local $mmove = DllStructCreate("ptr;flat;floatt;float")
- Local $mmoveptr = DllStructGetPtr($mmove)
- Local $mchangetarget = DllStructCreate("ptr;dword")
- Local $mchangetargetptr = DllStructGetPtr($mchangetarget)
- Local $mmove = DllStructCreate("ptr;flat;floatt;float")
- Local $mmoveptr = DllStructGetPtr($mmove)
- Local $mpacket = DllStructCreate("ptr;dord;dword;dword;dworrd;dword;dwrd;dword;wrd;dwowrd;dworrd;dwordd;dword")
- Local $mpacketptr = DllStructGetPtr($mpacket)
- Local $mwritechat = DllStructCreate("ptr")
- Local $mwritechatptr = DllStructGetPtr($mwritechat)
- Local $msellitem = DllStructCreate("ptr;dword;dword")
- Local $msellitemptr = DllStructGetPtr($msellitem)
- Local $maction = DllStructCreate("ptr;dword;dword")
- Local $mactionptr = DllStructGetPtr($maction)
- Local $mtogglelanguage = DllStructCreate("ptr;dword")
- Local $mtoguageptruageptr = DllStructGetPtr($mtogglelanguage)
- Local $museheroskill = DllStructCreate("ptr;dwrd;dwordd;dword")
- Local $museheroskillptr = DllStructGetPtr($museheroskill)
- Local $mbuyitem = DllStructCreate("ptr;dwrd;dwordd;dword")
- Local $mbuyitemptr = DllStructGetPtr($mbuyitem)
- Local $msendchat = DllStructCreate("ptr;dword")
- Local $msendchatptr = DllStructGetPtr($msendchat)
- Local $mrequestquote = DllStructCreate("ptr;dword")
- Local $mrequestquoteptr = DllStructGetPtr($mrequestquote)
- Local $mruotesellotesell = DllStructCreate("ptr;dword")
- Local $mrequesellptrsellptr = DllStructGetPtr($mruotesellotesell)
- Local $mtraderbuy = DllStructCreate("ptr")
- Local $mtraderbuyptr = DllStructGetPtr($mtraderbuy)
- Local $mtradersell = DllStructCreate("ptr")
- Local $mtradersellptr = DllStructGetPtr($mtradersell)
- Local $msalvage = DllStructCreate("ptr;dwrd;dwordd;dword")
- Local $msalvageptr = DllStructGetPtr($msalvage)
- Local $minttributetribute = DllStructCreate("ptr;dword;dword")
- Local $mincreibuteptrbuteptr = DllStructGetPtr($minttributetribute)
- Local $mdettributetribute = DllStructCreate("ptr;dword;dword")
- Local $mdecreibuteptrbuteptr = DllStructGetPtr($mdettributetribute)
- Local $mmakeagentarray = DllStructCreate("ptr;dword")
- Local $mmaarrayptrrrayptr = DllStructGetPtr($mmakeagentarray)
- #EndRegion CommandStructs
- #Region Memory
- Func memoryopen($apid)
- $mkernelhandle = DllOpen("kernel32.dll")
- Local $lopenprocess = DllCall($mkernelhandle, "int", "OpenProcess", "int", 2035711, "int", 1, "int", $apid)
- $mgwprochandle = $lopenprocess[0]
- EndFunc
- Func memoryclose()
- DllCall($mkernelhandle, "int", "CloseHandle", "int", $mgwprochandle)
- DllClose($mkernelhandle)
- EndFunc
- Func writebinary($abinarystring, $aaddress)
- Local $ldata = DllStructCreate("byte[" & 0.5 * StringLen($abinarystring) & "]"), $i
- For $i = 1 To DllStructGetSize($ldata)
- DllStructSetData($ldata, 1, Dec(StringMid($abinarystring, 2 * $i - 1, 2)), $i)
- Next
- DllCall($mkernelhandle, "int", "WrissMemorysMemory", "int", $mgwprochandle, "ptr", $aaddress, "ptr", DllStructGetPtr($ldata), "int", DllStructGetSize($ldata), "int", 0)
- EndFunc
- Func memorywrite($aaddress, $adata, $atype = "dword")
- Local $lbuffer = DllStructCreate($atype)
- DllStructSetData($lbuffer, 1, $adata)
- DllCall($mkernelhandle, "int", "WrissMemorysMemory", "int", $mgwprochandle, "int", $aaddress, "ptr", DllStructGetPtr($lbuffer), "int", DllStructGetSize($lbuffer), "int", "")
- EndFunc
- Func memoryread($aaddress, $atype = "dword")
- Local $lbuffer = DllStructCreate($atype)
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $aaddress, "ptr", DllStructGetPtr($lbuffer), "int", DllStructGetSize($lbuffer), "int", "")
- Return DllStructGetData($lbuffer, 1)
- EndFunc
- Func memoryreadptr($aaddress, $aoffset, $atype = "dword")
- Local $lpointercount = UBound($aoffset) - 2
- Local $lbuffer = DllStructCreate("dword")
- For $i = 0 To $lpointercount
- $aaddress += $aoffset[$i]
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $aaddress, "ptr", DllStructGetPtr($lbuffer), "int", DllStructGetSize($lbuffer), "int", "")
- $aaddress = DllStructGetData($lbuffer, 1)
- If $aaddress == 0 Then
- Local $ldata[2] = [0, 0]
- Return $ldata
- EndIf
- Next
- $aaddress += $aoffset[$lpointercount + 1]
- $lbuffer = DllStructCreate($atype)
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $aaddress, "ptr", DllStructGetPtr($lbuffer), "int", DllStructGetSize($lbuffer), "int", "")
- Local $ldata[2] = [$aaddress, DllStructGetData($lbuffer, 1)]
- Return $ldata
- EndFunc
- Func swapendian($ahex)
- Return StringMid($ahex, 7, 2) & StringMid($ahex, 5, 2) & StringMid($ahex, 3, 2) & StringMid($ahex, 1, 2)
- EndFunc
- #EndRegion Memory
- #Region Initialisation
- Func getloggedcharnames()
- Local $array = scangw()
- If $array[0] <= 1 Then Return ""
- Local $ret = $array[1]
- For $i = 2 To $array[0]
- $ret &= "|"
- $ret &= $array[$i]
- Next
- Return $ret
- EndFunc
- Func scangw()
- Local $lwinlist = WinList("Guild Wars")
- Local $lreturnarray[1] = [0]
- Local $lpid
- For $i = 1 To $lwinlist[0][0]
- $mgwhwnd = $lwinlist[$i][1]
- $lpid = WinGetProcess($mgwhwnd)
- If __processgetname($lpid) <> "gw.exe" Then ContinueLoop
- memoryopen(WinGetProcess($mgwhwnd))
- If $mgwprochandle Then
- $lreturnarray[0] += 1
- ReDim $lreturnarray[$lreturnarray[0] + 1]
- $lreturnarray[$lreturnarray[0]] = scanforcharname()
- EndIf
- memoryclose()
- $mgwprochandle = 0
- Next
- Return $lreturnarray
- EndFunc
- Func initialize($agw, $bchangetitle = True, $ausestringlog = False, $auseeventsystem = True)
- Global $charname1 = "Im ng Champg Champ"
- Global $charname1 = "Oo Shiko Oo"
- Global $charname2 = "I I Shiko I I"
- Global $charname3 = "Flamer Zwei"
- Global $charname4 = "Flamer Drei"
- Global $charname5 = "Flamer Vier"
- Global $charname6 = "Flamer Fuenf"
- Global $charname7 = "Flamer Sechs"
- Global $charname8 = "Flamer Sieben"
- Global $charname9 = "Flamer Neun"
- Global $charname10 = "Flamer Zehn"
- Global $charname11 = "Flamer Elf"
- Global $charname12 = "Flamer Zwoelf"
- Global $charname13 = "Rupt Bot Null"
- Local $lwinlist
- $musestringlog = $ausestringlog
- $museeventsystem = $auseeventsystem
- If IsString($agw) Then
- $lwinlist = WinList("Guild Wars")
- For $i = 1 To $lwinlist[0][0]
- $mgwhwnd = $lwinlist[$i][1]
- memoryopen(WinGetProcess($mgwhwnd))
- If $mgwprochandle Then
- If StringRegExp(scanforcharname(), $agw) = 1 Then ExitLoop
- EndIf
- memoryclose()
- $mgwprochandle = 0
- Next
- Else
- $lwinlist = WinList()
- For $i = 1 To $lwinlist[0][0]
- $mgwhwnd = $lwinlist[$i][1]
- If WinGetProcess($mgwhwnd) = $agw Then
- memoryopen($agw)
- scanforcharname()
- ExitLoop
- EndIf
- Next
- EndIf
- If $mgwprochandle = 0 Then Return 0
- scan()
- $mbasepointer = memoryread(getscannedaddress("ScanBasePointer", -3))
- setvalue("BasePointer", "0x" & Hex($mbasepointer, 8))
- $magentbase = memoryread(getscannedaddress("ScanAgentBase", 13))
- setvalue("AgentBase", "0x" & Hex($magentbase, 8))
- $mmaxagents = $magentbase + 8
- setvalue("MaxAgents", "0x" & Hex($mmaxagents, 8))
- $mmyid = $magentbase - 84
- setvalue("MyID", "0x" & Hex($mmyid, 8))
- $mmaploading = $magentbase - 240
- $mcurrenttarget = $magentbase - 1280
- setvalue("PacketLocation", "0x" & Hex(memoryread(getscannedaddress("ScanBaseOffset", -3)), 8))
- $mping = memoryread(getscannedaddress("ScanPing", -8))
- $mmapid = memoryread(getscannedaddress("ScanMapID", 71))
- $mloggedin = memoryread(getscannedaddress("ScanLoggedIn", -3)) + 4
- $mregion = memoryread(getscannedaddress("ScanRegion", 8))
- $mlanguage = memoryread(getscannedaddress("ScanLanguage", 8)) + 12
- $mskillbase = memoryread(getscannedaddress("ScanSkillBase", 9))
- $mskilltimer = memoryread(getscannedaddress("ScanSkillTimer", -3))
- $mbuildnumber = memoryread(getscannedaddress("ScanBuildNumber", 84))
- $mzoomstill = getscannedaddress("ScanZoomStill", -1)
- $mzoommoving = getscannedaddress("ScanZoomMoving", 5)
- Local $ltemp
- $ltemp = getscannedaddress("ScanEngine", -16)
- setvalue("MainStart", "0x" & Hex($ltemp, 8))
- setvalue("MainReturn", "0x" & Hex($ltemp + 5, 8))
- setvalue("RenderingMod", "0x" & Hex($ltemp + 116, 8))
- setvalue("RenodReturndReturn", "0x" & Hex($ltemp + 132 + 6, 8))
- $ltemp = getscannedaddress("ScanTargetLog", 1)
- setvalue("TargetLogStart", "0x" & Hex($ltemp, 8))
- setvalue("TargetLogReturn", "0x" & Hex($ltemp + 5, 8))
- $ltemp = getscannedaddress("ScanSkillLog", 1)
- setvalue("SkillLogStart", "0x" & Hex($ltemp, 8))
- setvalue("SkillLogReturn", "0x" & Hex($ltemp + 5, 8))
- $ltemp = getscannedaddress("ScanSpleteLogleteLog", -4)
- setvalue("SkillCLogStartogStart", "0x" & Hex($ltemp, 8))
- setvalue("SkillCoogReturngReturn", "0x" & Hex($ltemp + 5, 8))
- $ltemp = getscannedaddress("ScaancelLogncelLog", 5)
- setvalue("SkilLogStartogStart", "0x" & Hex($ltemp, 8))
- setvalue("SkillogReturngReturn", "0x" & Hex($ltemp + 6, 8))
- $ltemp = getscannedaddress("ScanChatLog", 18)
- setvalue("ChatLogStart", "0x" & Hex($ltemp, 8))
- setvalue("ChatLogReturn", "0x" & Hex($ltemp + 6, 8))
- $ltemp = getscannedaddress("ScanTraderHook", -7)
- setvalue("TraderHookStart", "0x" & Hex($ltemp, 8))
- setvalue("TraderHookReturn", "0x" & Hex($ltemp + 5, 8))
- $ltemp = getscannedaddress("ScgFilter1Filter1", -2)
- setvalue("Strer1Startr1Start", "0x" & Hex($ltemp, 8))
- setvalue("Strir1Return1Return", "0x" & Hex($ltemp + 5, 8))
- $ltemp = getscannedaddress("ScgFilter2Filter2", -2)
- setvalue("Strer2Startr2Start", "0x" & Hex($ltemp, 8))
- setvalue("Strir2Return2Return", "0x" & Hex($ltemp + 5, 8))
- setvalue("StringLogStart", "0x" & Hex(getscannedaddress("ScanStringLog", 35), 8))
- setvalue("LohedStartedStart", "0x" & Hex(getscannedaddress("ScanLoadFinished", 1), 8))
- setvalue("LoaedReturndReturn", "0x" & Hex(getscannedaddress("ScanLoadFinished", 6), 8))
- setvalue("PostMessage", "0x" & Hex(memoryread(getscannedaddress("ScanPostMessage", 11)), 8))
- setvalue("Sleep", memoryread(memoryread(getvalue("ScanSleep") + 8) + 3))
- setvalue("SalvageFunction", memoryread(getvalue("ScanFunctionunction") + 8) - 18)
- setvalue("SalvageGlobal", memoryread(memoryread(getvalue("ScgeGlobaleGlobal") + 8) + 1))
- setvalue("IncreaseAtFunctioFunction", "0x" & Hex(getscannedaddress("ScanIncreaseAtFunctioFunction", -96), 8))
- setvalue("DecreaseAtFunctioFunction", "0x" & Hex(getscannedaddress("ScanIncreaseAtFunctioFunction", -288), 8))
- setvalue("MoveFunction", "0x" & Hex(getscannedaddress("ScanMoveFunction", 1), 8))
- setvalue("UseSkillFunction", "0x" & Hex(getscannedaddress("ScanUFunctionunction", 1), 8))
- setvalue("ChangFunctionunction", "0x" & Hex(getscannedaddress("ScanChangFunctioFunction", -119), 8))
- setvalue("WrFunctionunction", "0x" & Hex(getscannedaddress("ScanWrFunctionunction", 1), 8))
- setvalue("SellItemFunction", "0x" & Hex(getscannedaddress("ScanSFunctionunction", -85), 8))
- setvalue("PacFunctionunction", "0x" & Hex(getscannedaddress("ScanPacFunctionunction", 1), 8))
- setvalue("ActionBase", "0x" & Hex(memoryread(getscannedaddress("ScanActionBase", -9)), 8))
- setvalue("ActionFunction", "0x" & Hex(getscannedaddress("ScaFunctionunction", -5), 8))
- setvalue("UseHeFunctionunction", "0x" & Hex(getscannedaddress("ScanUseHeFunctioFunction", -161), 8))
- setvalue("BuyItemFunction", "0x" & Hex(getscannedaddress("ScanFunctionunction", 1), 8))
- setvalue("RequeFunctionunction", "0x" & Hex(getscannedaddress("ScanRequeFunctioFunction", -2), 8))
- setvalue("TraderFunction", "0x" & Hex(getscannedaddress("ScaFunctionunction", -71), 8))
- setvalue("ClickToMoveFix", "0x" & Hex(getscannedaddress("ScaoMoveFixMoveFix", 1), 8))
- setvalue("QueueSize", "0x00000010")
- setvalue("SkillLogSize", "0x00000010")
- setvalue("ChatLogSize", "0x00000010")
- setvalue("TargetLogSize", "0x00000200")
- setvalue("StringLogSize", "0x00000200")
- setvalue("CallbackEvent", "0x00000501")
- modifymemory()
- $mqueuecounter = memoryread(getvalue("QueueCounter"))
- $mqueuesize = getvalue("QueueSize") - 1
- $mqueuebase = getvalue("QueueBase")
- $mtargetlogbase = getvalue("TargetLogBase")
- $mstringlogbase = getvalue("StringLogBase")
- $mmapisloaded = getvalue("MapIsLoaded")
- $mensureenglish = getvalue("EnsureEnglish")
- $mtraderquoteid = getvalue("TraderQuoteID")
- $mtradercostid = getvalue("TraderCostID")
- $mtradercostvalue = getvalue("TraderCostValue")
- $mdenderingndering = getvalue("DisableRendering")
- $magentcopycount = getvalue("AgentCopyCount")
- $magentcopybase = getvalue("AgentCopyBase")
- If $museeventsystem Then memorywrite(getvalue("CallbackHandle"), $mgui)
- DllStructSetData($museskill, 1, getvalue("CommandUseSkill"))
- DllStructSetData($mmove, 1, getvalue("CommandMove"))
- DllStructSetData($mchangetarget, 1, getvalue("CommgeTargeteTarget"))
- DllStructSetData($mpacket, 1, getvalue("CocketSendketSend"))
- DllStructSetData($msellitem, 1, getvalue("CommandSellItem"))
- DllStructSetData($maction, 1, getvalue("CommandAction"))
- DllStructSetData($mtogglelanguage, 1, getvalue("CommanLanguageanguage"))
- DllStructSetData($museheroskill, 1, getvalue("CommeroSkillroSkill"))
- DllStructSetData($mbuyitem, 1, getvalue("CommandBuyItem"))
- DllStructSetData($msendchat, 1, getvalue("CommandSendChat"))
- DllStructSetData($msendchat, 2, 94)
- DllStructSetData($mwritechat, 1, getvalue("CommandWriteChat"))
- DllStructSetData($mrequestquote, 1, getvalue("CommestQuotestQuote"))
- DllStructSetData($mruotesellotesell, 1, getvalue("CommandRuoteSelloteSell"))
- DllStructSetData($mtraderbuy, 1, getvalue("CommandTraderBuy"))
- DllStructSetData($mtradersell, 1, getvalue("CoaderSellderSell"))
- DllStructSetData($msalvage, 1, getvalue("CommandSalvage"))
- DllStructSetData($minttributetribute, 1, getvalue("CommandInttributttribute"))
- DllStructSetData($mdettributetribute, 1, getvalue("CommandDettributttribute"))
- DllStructSetData($mmakeagentarray, 1, getvalue("CommanentArrayntArray"))
- If $bchangetitle Then WinSetTitle($mgwhwnd, "", "Guild Wars - " & getcharname())
- Return $mgwhwnd
- EndFunc
- Func getvalue($akey)
- For $i = 1 To $mlabels[0][0]
- If $mlabels[$i][0] = $akey Then Return Number($mlabels[$i][1])
- Next
- Return -1
- EndFunc
- Func setvalue($akey, $avalue)
- $mlabels[0][0] += 1
- ReDim $mlabels[$mlabels[0][0] + 1][2]
- $mlabels[$mlabels[0][0]][0] = $akey
- $mlabels[$mlabels[0][0]][1] = $avalue
- EndFunc
- Func scan()
- $masmsize = 0
- $masmcodeoffset = 0
- $masmstring = ""
- _("MainModPtr/4")
- _("ScanBasePointer:")
- addpattern("85C0750F8BCE")
- _("ScanAgentBase:")
- addpattern("568BF13BF07204")
- _("ScanEngine:")
- addpattern("5356DFE0F6C441")
- _("Scinished:nished:")
- addpattern("8B561C8BCF52E8")
- _("ScanPostMessage:")
- addpattern("6A0060051FF15051FF15")
- _("ScanTargetLog:")
- addpattern("535894DF4E894DF4E8")
- _("ScanChangeunctionunction:")
- addpattern("33C03BDA0F95C033")
- _("Scunction:nction:")
- addpattern("558BEC83EC2F98D4DFF98D4DF0")
- _("ScanPing:")
- addpattern("90849186A309186A30")
- _("ScanMapID:")
- addpattern("B07F8D55")
- _("ScanLoggedIn:")
- addpattern("85C07411B807")
- _("ScanRegion:")
- addpattern("83F9FD7406")
- _("ScanLanguage:")
- addpattern("C38B75FC8B04B5")
- _("ScanUsunction:nction:")
- addpattern("558BEC83EC1053568F2895DFF2895DF0")
- _("ScanChangeunctionunction:")
- addpattern("33C03BDA0F95C033")
- _("ScanPackunction:nction:")
- addpattern("558BEC83E578BF98578BF985")
- _("ScanBaseOffset:")
- addpattern("5633F0E5633D2E5633D2")
- _("ScanWriunction:nction:")
- addpattern("558BEC515389408565780856578B")
- _("ScanSkillLog:")
- addpattern("408946105E5B5D")
- _("ScanSkleteLog:eteLog:")
- addpattern("741D6A006A40")
- _("ScanncelLog:celLog:")
- addpattern("85C0741D6A006A42")
- _("ScanChatLog:")
- addpattern("8B48B4DEC50B4DEC50")
- _("ScanSeunction:nction:")
- addpattern("8B4D2085C90F858E")
- _("ScanStringLog:")
- addpattern("893E8B704397E084397E08")
- _("ScaFilter1:ilter1:")
- addpattern("51568B7F9833E009833E00")
- _("ScaFilter2:ilter2:")
- addpattern("5153565D28B4F2C28B4F2C")
- _("Scanunction:nction:")
- addpattern("8B7D0883FF098BF760100076010000")
- _("ScanActionBase:")
- addpattern("8B420418B4A0818B4A08")
- _("ScanSkillBase:")
- addpattern("8D04B65EC1E00505")
- _("ScanUseHerunctionunction:")
- addpattern("8D0C765F5E8B")
- _("ScanBunction:nction:")
- addpattern("558BEC81ECC000000053568B7F8BD976F8BD97618BD97614")
- _("ScanRequesunctionunction:")
- addpattern("81E0053568B053568B")
- _("Scanunction:nction:")
- addpattern("8B45188B551085")
- _("ScanTraderHook:")
- addpattern("8955F55F8B9BA5F8B9BA")
- _("ScanSleep:")
- addpattern("5F5E560EA00000EA0000")
- _("ScanSunction:nction:")
- addpattern("8BFA8F0895DF40895DF4")
- _("ScaeGlobal:Global:")
- addpattern("8B018B4904A3")
- _("ScanIncreaseAttunctionunction:")
- addpattern("8B702C8B3B8B86")
- _("ScanDecreaseAttunctionunction:")
- addpattern("8B4B06A016A04A016A04")
- _("ScanSkillTimer:")
- addpattern("85c9741d183fa64183fa64")
- _("ScanMoveFix:oveFix:")
- addpattern("3DD301000074")
- _("ScanZoomStill:")
- addpattern("3B448BCB")
- _("ScanZoomMoving:")
- addpattern("50EB13B448BCEB448BCE")
- _("ScanBuildNumber:")
- addpattern("8D8500FCFFFF8D")
- _("ScanProc:")
- _("pushad")
- _("mov ecx,401000")
- _("mov esi,ScanProc")
- _("ScanLoop:")
- _("inc ecx")
- _("mov al,byte[ecx]")
- _("mov edx,ePointerPointer")
- _("ScanInnerLoop:")
- _("movord[edx]rd[edx]")
- _("cmp ebx,-1")
- _("jnz ScanContinue")
- _("add edx,50")
- _("cmp edx,esi")
- _("jnnnerLoopnerLoop")
- _("cmp ecx,900000")
- _("jnz ScanLoop")
- _("jmp ScanExit")
- _("ScanContinue:")
- _("lea ediedx+ebx]dx+ebx]")
- _("add edi,C")
- _("mov ah,byte[edi]")
- _("cmp al,ah")
- _("jz ScanMatched")
- _("mov dword[edx],0")
- _("add edx,50")
- _("cmp edx,esi")
- _("jnnnerLoopnerLoop")
- _("cmp ecx,900000")
- _("jnz ScanLoop")
- _("jmp ScanExit")
- _("ScanMatched:")
- _("inc ebx")
- _("mov ed[edx+4][edx+4]")
- _("cmp ebx,edi")
- _("jz ScanFound")
- _("movedx],ebxdx],ebx")
- _("add edx,50")
- _("cmp edx,esi")
- _("jnnnerLoopnerLoop")
- _("cmp ecx,900000")
- _("jnz ScanLoop")
- _("jmp ScanExit")
- _("ScanFound:")
- _("lea ed[edx+8][edx+8]")
- _("movedi],ecxdi],ecx")
- _("mo[edx],-1edx],-1")
- _("add edx,50")
- _("cmp edx,esi")
- _("jnnnerLoopnerLoop")
- _("cmp ecx,900000")
- _("jnz ScanLoop")
- _("ScanExit:")
- _("popad")
- _("retn")
- Local $lscanmemory = memoryread($mbase, "ptr")
- If $lscanmemory = 0 Then
- $mmemory = DllCall($mkernelhandle, "ptr", "VirtualAllocEx", "handle", $mgwprochandle, "ptr", 0, "ulong_ptr", $masmsize, "dword", 4096, "dword", 64)
- $mmemory = $mmemory[0]
- memorywrite($mbase, $mmemory)
- Else
- $mmemory = $lscanmemory
- EndIf
- completeasmcode()
- If $lscanmemory = 0 Then
- writebinary($masmstring, $mmemory + $masmcodeoffset)
- Local $lthread = DllCall($mkernelhandle, "int", "CreteThreadeThread", "int", $mgwprochandle, "ptr", 0, "int", 0, "int", getlabelinfo("ScanProc"), "ptr", 0, "int", 0, "int", 0)
- $lthread = $lthread[0]
- Local $lresult
- Do
- $lresult = DllCall($mkernelhandle, "int", "WaitleObjecteObject", "int", $lthread, "int", 50)
- Until $lresult[0] <> 258
- DllCall($mkernelhandle, "int", "CloseHandle", "int", $lthread)
- EndIf
- EndFunc
- Func addpattern($apattern)
- Local $lsize = Int(0.5 * StringLen($apattern))
- $masmstring &= "00000000" & swapendian(Hex($lsize, 8)) & "00000000" & $apattern
- $masmsize += $lsize + 12
- For $i = 1 To 68 - $lsize
- $masmsize += 1
- $masmstring &= "00"
- Next
- EndFunc
- Func getscannedaddress($alabel, $aoffset)
- Return memoryread(getlabelinfo($alabel) + 8) - memoryread(getlabelinfo($alabel) + 4) + $aoffset
- EndFunc
- Func scanforcharname()
- Local $lcharnamecode = BinaryToString("0x90909066C705")
- Local $lcurrehaddressaddress = 4198400
- Local $lmbi[7], $lmbibuffer = DllStructCreate("dword;dword;dword;wrd;dworrd;dworrd;dword")
- Local $lsearch, $ltmpmemdata, $ltmpaddress, $ltmpbuffer = DllStructCreate("ptr"), $i
- While $lcurrehaddressaddress < 9437184
- Local $lmbi[7]
- DllCall($mkernelhandle, "int", "VirtualQueryEx", "int", $mgwprochandle, "int", $lcurrehaddressaddress, "ptr", DllStructGetPtr($lmbibuffer), "int", DllStructGetSize($lmbibuffer))
- For $i = 0 To 6
- $lmbi[$i] = StringStripWS(DllStructGetData($lmbibuffer, ($i + 1)), 3)
- Next
- If $lmbi[4] = 4096 Then
- Local $lbuffer = DllStructCreate("byte[" & $lmbi[3] & "]")
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $lcurrehaddressaddress, "ptr", DllStructGetPtr($lbuffer), "int", DllStructGetSize($lbuffer), "int", "")
- $ltmpmemdata = DllStructGetData($lbuffer, 1)
- $ltmpmemdata = BinaryToString($ltmpmemdata)
- $lsearch = StringInStr($ltmpmemdata, $lcharnamecode, 2)
- If $lsearch > 0 Then
- $ltmpaddress = $lcurrehaddressaddress + $lsearch - 1
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $ltmpaddress + 6, "ptr", DllStructGetPtr($ltmpbuffer), "int", DllStructGetSize($ltmpbuffer), "int", "")
- $mcharname = DllStructGetData($ltmpbuffer, 1)
- Return getcharname()
- EndIf
- $lcurrehaddressaddress += $lmbi[3]
- EndIf
- WEnd
- Return ""
- EndFunc
- #EndRegion Initialisation
- #Region Commands
- #Region Item
- Func startsalvage($aitem)
- Local $loffset[4] = [0, 24, 44, 1680]
- Local $lsessionidssionid = memoryreadptr($mbasepointer, $loffset)
- If IsDllStruct($aitem) = 0 Then
- Local $litemid = $aitem
- Else
- Local $litemid = DllStructGetData($aitem, "ID")
- EndIf
- Local $lsalvagekit = findsalvagekit()
- If $lsalvagekit = 0 Then Return
- DllStructSetData($msalvage, 2, $litemid)
- DllStructSetData($msalvage, 3, findsalvagekit())
- DllStructSetData($msalvage, 4, $lsessionidssionid[1])
- enqueue($msalvageptr, 16)
- EndFunc
- Func salvagematerials()
- Return sendpacket(4, 115)
- EndFunc
- Func salvagemod($amodindex)
- Return sendpacket(8, 116, $amodindex)
- EndFunc
- Func identifyitem($aitem)
- If getisided($aitem) Then Return
- Local $litemid
- If IsDllStruct($aitem) = 0 Then
- $litemid = $aitem
- Else
- $litemid = DllStructGetData($aitem, "ID")
- EndIf
- Local $lidkit = findidkit()
- If $lidkit == 0 Then Return
- sendpacket(12, 101, $lidkit, $litemid)
- Local $ldeadlock = TimerInit()
- Do
- Sleep(20)
- Until getisided($litemid) OR TimerDiff($ldeadlock) > 5000
- If NOT getisided($litemid) Then identifyitem($aitem)
- EndFunc
- Func identifybag($abag, $awhites = False, $agolds = True)
- Local $litem
- If NOT IsDllStruct($abag) Then $abag = getbag($abag)
- For $i = 1 To DllStructGetData($abag, "Slots")
- $litem = getitembyslot($abag, $i)
- If DllStructGetData($litem, "ID") == 0 Then ContinueLoop
- If getrarity($litem) == 2621 AND $awhites == False Then ContinueLoop
- If getrarity($litem) == 2624 AND $agolds == False Then ContinueLoop
- identifyitem($litem)
- Sleep(getping())
- Next
- EndFunc
- Func equipitem($aitem)
- Local $litemid
- If IsDllStruct($aitem) = 0 Then
- $litemid = $aitem
- Else
- $litemid = DllStructGetData($aitem, "ID")
- EndIf
- Return sendpacket(8, 41, $litemid)
- EndFunc
- Func useitem($aitem)
- Local $litemid
- If IsDllStruct($aitem) = 0 Then
- $litemid = $aitem
- Else
- $litemid = DllStructGetData($aitem, "ID")
- EndIf
- Return sendpacket(8, 119, $litemid)
- EndFunc
- Func pickupitem($aitem)
- Local $lagentid
- If IsDllStruct($aitem) = 0 Then
- $lagentid = $aitem
- ElseIf DllStructGetSize($aitem) < 400 Then
- $lagentid = DllStructGetData($aitem, "AgentID")
- Else
- $lagentid = DllStructGetData($aitem, "ID")
- EndIf
- Return sendpacket(12, 56, $lagentid, 0)
- EndFunc
- Func dropitem($aitem, $aamount = 0)
- Local $litemid, $lamount
- If IsDllStruct($aitem) = 0 Then
- $litemid = $aitem
- If $aamount > 0 Then
- $lamount = $aamount
- Else
- $lamount = DllStructGetData(getitembyitemid($aitem), "Quantity")
- EndIf
- Else
- $litemid = DllStructGetData($aitem, "ID")
- If $aamount > 0 Then
- $lamount = $aamount
- Else
- $lamount = DllStructGetData($aitem, "Quantity")
- EndIf
- EndIf
- Return sendpacket(12, 37, $litemid, $lamount)
- EndFunc
- Func moveitem($aitem, $abag, $aslot)
- Local $litemid, $lbagid
- If IsDllStruct($aitem) = 0 Then
- $litemid = $aitem
- Else
- $litemid = DllStructGetData($aitem, "ID")
- EndIf
- If IsDllStruct($abag) = 0 Then
- $lbagid = DllStructGetData(getbag($abag), "ID")
- Else
- $lbagid = DllStructGetData($abag, "ID")
- EndIf
- Return sendpacket(16, 107, $litemid, $lbagid, $aslot - 1)
- EndFunc
- Func acceptallitems()
- Return sendpacket(8, 108, DllStructGetData(getbag(7), "ID"))
- EndFunc
- Func sellitem($aitem, $aquantity = 0)
- If IsDllStruct($aitem) = 0 Then $aitem = getitembyitemid($aitem)
- If $aquantity = 0 OR $aquantity > DllStructGetData($aitem, "Quantity") Then $aquantity = DllStructGetData($aitem, "Quantity")
- DllStructSetData($msellitem, 2, $aquantity * DllStructGetData($aitem, "Value"))
- DllStructSetData($msellitem, 3, DllStructGetData($aitem, "ID"))
- enqueue($msellitemptr, 12)
- EndFunc
- Func buyitem($aitem, $aquantity, $avalue)
- Local $lmetemsbaseemsbase = getmerchantitemsbase()
- If NOT $lmetemsbaseemsbase Then Return
- If $aitem < 1 OR $aitem > getmerchantitemssize() Then Return
- DllStructSetData($mbuyitem, 2, $aquantity)
- DllStructSetData($mbuyitem, 3, memoryread($lmetemsbaseemsbase + 4 * ($aitem - 1)))
- DllStructSetData($mbuyitem, 4, $aquantity * $avalue)
- enqueue($mbuyitemptr, 16)
- EndFunc
- Func buyidkit()
- buyitem(5, 1, 100)
- EndFunc
- Func buysuperioridkit()
- buyitem(6, 1, 500)
- EndFunc
- Func traderrequest($amodelid, $aextraid = -1)
- Local $litemstruct = DllStructCreate("long agentId;byte unknow unknown1[4];ptr bag;ptr modstruct;long modstructsize;ptr customized;byte unknown2[4];byte type;byte unknown3;short extraId;short value;byte unknown4[2];short interaction;long modelId;ptr modString;byte unknown5[4];ptr NameString;byte unknown6[15];byte quantity;bipped;bytwyte slwyte sloyte slotte slot")
- Local $loffset[4] = [0, 24, 64, 192]
- Local $litemarraysize = memoryreadptr($mbasepointer, $loffset)
- Local $loffset[5] = [0, 24, 64, 184, 0]
- Local $litemptr, $litemid
- Local $lfound = False
- Local $lquoteid = memoryread($mtraderquoteid)
- For $litemid = 1 To $litemarraysize[1]
- $loffset[4] = 4 * $litemid
- $litemptr = memoryreadptr($mbasepointer, $loffset)
- If $litemptr[1] = 0 Then ContinueLoop
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $litemptr[1], "ptr", DllStructGetPtr($litemstruct), "int", DllStructGetSize($litemstruct), "int", "")
- If DllStructGetData($litemstruct, "ModelID") = $amodelid AND DllStructGetData($litemstruct, "bag") = 0 AND DllStructGetData($litemstruct, "AgentID") == 0 Then
- If $aextraid = -1 OR DllStructGetData($litemstruct, "ExtraID") = $aextraid Then
- $lfound = True
- ExitLoop
- EndIf
- EndIf
- Next
- If NOT $lfound Then Return False
- DllStructSetData($mrequestquote, 2, DllStructGetData($litemstruct, "ID"))
- enqueue($mrequestquoteptr, 8)
- Local $ldeadlock = TimerInit()
- $lfound = False
- Do
- Sleep(20)
- $lfound = memoryread($mtraderquoteid) <> $lquoteid
- Until $lfound OR TimerDiff($ldeadlock) > getping() + 5000
- Return $lfound
- EndFunc
- Func traderbuy()
- If NOT gettradercostid() OR NOT gettradercostvalue() Then Return False
- enqueue($mtraderbuyptr, 4)
- Return True
- EndFunc
- Func traderrequestsell($aitem)
- Local $litemid
- Local $lfound = False
- Local $lquoteid = memoryread($mtraderquoteid)
- If IsDllStruct($aitem) = 0 Then
- $litemid = $aitem
- Else
- $litemid = DllStructGetData($aitem, "ID")
- EndIf
- DllStructSetData($mruotesellotesell, 2, $litemid)
- enqueue($mrequesellptrsellptr, 8)
- Local $ldeadlock = TimerInit()
- Do
- Sleep(20)
- $lfound = memoryread($mtraderquoteid) <> $lquoteid
- Until $lfound OR TimerDiff($ldeadlock) > getping() + 5000
- Return $lfound
- EndFunc
- Func tradersell()
- If NOT gettradercostid() OR NOT gettradercostvalue() Then Return False
- enqueue($mtradersellptr, 4)
- Return True
- EndFunc
- Func dropgold($aamount = 0)
- Local $lamount
- If $aamount > 0 Then
- $lamount = $aamount
- Else
- $lamount = getgoldcharacter()
- EndIf
- Return sendpacket(8, 40, $lamount)
- EndFunc
- Func depositgold($aamount = 0)
- Local $lamount
- Local $lstorage = getgoldstorage()
- Local $lcharacter = getgoldcharacter()
- If $aamount > 0 AND $lcharacter >= $aamount Then
- $lamount = $aamount
- Else
- $lamount = $lcharacter
- EndIf
- If $lstorage + $lamount > 1000000 Then $lamount = 1000000 - $lstorage
- changegold($lcharacter - $lamount, $lstorage + $lamount)
- EndFunc
- Func withdrawgold($aamount = 0)
- Local $lamount
- Local $lstorage = getgoldstorage()
- Local $lcharacter = getgoldcharacter()
- If $aamount > 0 AND $lstorage >= $aamount Then
- $lamount = $aamount
- Else
- $lamount = $lstorage
- EndIf
- If $lcharacter + $lamount > 100000 Then $lamount = 100000 - $lcharacter
- changegold($lcharacter + $lamount, $lstorage - $lamount)
- EndFunc
- Func changegold($acharacter, $astorage)
- Return sendpacket(12, 117, $acharacter, $astorage)
- EndFunc
- #EndRegion Item
- #Region H&H
- Func addhero($aheroid)
- Return sendpacket(8, 22, $aheroid)
- EndFunc
- Func kickhero($aheroid)
- Return sendpacket(8, 23, $aheroid)
- EndFunc
- Func kickallheroes()
- Return sendpacket(8, 23, 38)
- EndFunc
- Func addnpc($anpcid)
- Return sendpacket(8, 152, $anpcid)
- EndFunc
- Func kicknpc($anpcid)
- Return sendpacket(8, 161, $anpcid)
- EndFunc
- Func cancelhero($aheronumber)
- Local $lagentid = getheroid($aheronumber)
- Return sendpacket(20, 18, $lagentid, 2139095040, 2139095040, 0)
- EndFunc
- Func cancelall()
- Return sendpacket(16, 19, 2139095040, 2139095040, 0)
- EndFunc
- Func commandhero($aheronumber, $ax, $ay)
- Return sendpacket(20, 18, getheroid($aheronumber), floattoint($ax), floattoint($ay), 0)
- EndFunc
- Func commandall($ax, $ay)
- Return sendpacket(16, 19, floattoint($ax), floattoint($ay), 0)
- EndFunc
- Func lockherotarget($aheronumber, $aagentid = 0)
- Local $lheroid = getheroid($aheronumber)
- Return sendpacket(12, 14, $lheroid, $aagentid)
- EndFunc
- Func setheroaggression($aheronumber, $aaggression)
- Local $lheroid = getheroid($aheronumber)
- Return sendpacket(12, 13, $lheroid, $aaggression)
- EndFunc
- Func disableheroskillslot($aheronumber, $askillslot)
- If NOT getisheroskillslotdisabled($aheronumber, $askillslot) Then changeheroskillslotstate($aheronumber, $askillslot)
- EndFunc
- Func enableheroskillslot($aheronumber, $askillslot)
- If getisheroskillslotdisabled($aheronumber, $askillslot) Then changeheroskillslotstate($aheronumber, $askillslot)
- EndFunc
- Func changeheroskillslotstate($aheronumber, $askillslot)
- Return sendpacket(12, 17, getheroid($aheronumber), $askillslot - 1)
- EndFunc
- Func useheroskill($ahero, $askillslot, $atarget = 0)
- Local $ltargetid
- If IsDllStruct($atarget) = 0 Then
- $ltargetid = convertid($atarget)
- Else
- $ltargetid = DllStructGetData($atarget, "ID")
- EndIf
- DllStructSetData($museheroskill, 2, getheroid($ahero))
- DllStructSetData($museheroskill, 3, $ltargetid)
- DllStructSetData($museheroskill, 4, $askillslot - 1)
- enqueue($museheroskillptr, 16)
- EndFunc
- #EndRegion H&H
- #Region Movement
- Func move($ax, $ay, $arandom = 50)
- If getagentexists(-2) Then
- DllStructSetData($mmove, 2, $ax + Random(-$arandom, $arandom))
- DllStructSetData($mmove, 3, $ay + Random(-$arandom, $arandom))
- enqueue($mmoveptr, 16)
- Return True
- Else
- Return False
- EndIf
- EndFunc
- Func moveto($ax, $ay, $arandom = 50)
- Local $lblocked = 0
- Local $lme
- Local $lmaploading = getmaploading(), $lmaploadingold
- Local $ldestx = $ax + Random(-$arandom, $arandom)
- Local $ldesty = $ay + Random(-$arandom, $arandom)
- move($ldestx, $ldesty, 0)
- Do
- Sleep(100)
- $lme = getagentbyid(-2)
- If DllStructGetData($lme, "HP") <= 0 Then ExitLoop
- $lmaploadingold = $lmaploading
- $lmaploading = getmaploading()
- If $lmaploading <> $lmaploadingold Then ExitLoop
- If DllStructGetData($lme, "MoveX") == 0 AND DllStructGetData($lme, "MoveY") == 0 Then
- $lblocked += 1
- $ldestx = $ax + Random(-$arandom, $arandom)
- $ldesty = $ay + Random(-$arandom, $arandom)
- move($ldestx, $ldesty, 0)
- EndIf
- Until computedistance(DllStructGetData($lme, "X"), DllStructGetData($lme, "Y"), $ldestx, $ldesty) < 25 OR $lblocked > 14
- EndFunc
- Func goplayer($aagent)
- Local $lagentid
- If IsDllStruct($aagent) = 0 Then
- $lagentid = convertid($aagent)
- Else
- $lagentid = DllStructGetData($aagent, "ID")
- EndIf
- Return sendpacket(8, 44, $lagentid)
- EndFunc
- Func gonpc($aagent)
- Local $lagentid
- If IsDllStruct($aagent) = 0 Then
- $lagentid = convertid($aagent)
- Else
- $lagentid = DllStructGetData($aagent, "ID")
- EndIf
- Return sendpacket(12, 50, $lagentid)
- EndFunc
- Func gotonpc($aagent)
- If NOT IsDllStruct($aagent) Then $aagent = getagentbyid($aagent)
- Local $lme
- Local $lblocked = 0
- Local $lmaploading = getmaploading(), $lmaploadingold
- move(DllStructGetData($aagent, "X"), DllStructGetData($aagent, "Y"), 100)
- Sleep(100)
- gonpc($aagent)
- Do
- Sleep(100)
- $lme = getagentbyid(-2)
- If DllStructGetData($lme, "HP") <= 0 Then ExitLoop
- $lmaploadingold = $lmaploading
- $lmaploading = getmaploading()
- If $lmaploading <> $lmaploadingold Then ExitLoop
- If DllStructGetData($lme, "MoveX") == 0 AND DllStructGetData($lme, "MoveY") == 0 Then
- $lblocked += 1
- move(DllStructGetData($aagent, "X"), DllStructGetData($aagent, "Y"), 100)
- Sleep(100)
- gonpc($aagent)
- EndIf
- Until computedistance(DllStructGetData($lme, "X"), DllStructGetData($lme, "Y"), DllStructGetData($aagent, "X"), DllStructGetData($aagent, "Y")) < 250 OR $lblocked > 14
- Sleep(getping() + Random(1500, 2000, 1))
- EndFunc
- Func gosignpost($aagent)
- Local $lagentid
- If IsDllStruct($aagent) = 0 Then
- $lagentid = convertid($aagent)
- Else
- $lagentid = DllStructGetData($aagent, "ID")
- EndIf
- Return sendpacket(12, 74, $lagentid, 0)
- EndFunc
- Func gotosignpost($aagent)
- If NOT IsDllStruct($aagent) Then $aagent = getagentbyid($aagent)
- Local $lme
- Local $lblocked = 0
- Local $lmaploading = getmaploading(), $lmaploadingold
- move(DllStructGetData($aagent, "X"), DllStructGetData($aagent, "Y"), 100)
- Sleep(100)
- gosignpost($aagent)
- Do
- Sleep(100)
- $lme = getagentbyid(-2)
- If DllStructGetData($lme, "HP") <= 0 Then ExitLoop
- $lmaploadingold = $lmaploading
- $lmaploading = getmaploading()
- If $lmaploading <> $lmaploadingold Then ExitLoop
- If DllStructGetData($lme, "MoveX") == 0 AND DllStructGetData($lme, "MoveY") == 0 Then
- $lblocked += 1
- move(DllStructGetData($aagent, "X"), DllStructGetData($aagent, "Y"), 100)
- Sleep(100)
- gosignpost($aagent)
- EndIf
- Until computedistance(DllStructGetData($lme, "X"), DllStructGetData($lme, "Y"), DllStructGetData($aagent, "X"), DllStructGetData($aagent, "Y")) < 250 OR $lblocked > 14
- Sleep(getping() + Random(1500, 2000, 1))
- EndFunc
- Func attack($aagent, $acalltarget = False)
- Local $lagentid
- If IsDllStruct($aagent) = 0 Then
- $lagentid = convertid($aagent)
- Else
- $lagentid = DllStructGetData($aagent, "ID")
- EndIf
- Return sendpacket(12, 31, $lagentid, $acalltarget)
- EndFunc
- Func turnleft($aturn)
- If $aturn Then
- Return performaction(162, 24)
- Else
- Return performaction(162, 26)
- EndIf
- EndFunc
- Func turnright($aturn)
- If $aturn Then
- Return performaction(163, 24)
- Else
- Return performaction(163, 26)
- EndIf
- EndFunc
- Func movebackward($amove)
- If $amove Then
- Return performaction(172, 24)
- Else
- Return performaction(172, 26)
- EndIf
- EndFunc
- Func moveforward($amove)
- If $amove Then
- Return performaction(173, 24)
- Else
- Return performaction(173, 26)
- EndIf
- EndFunc
- Func strafeleft($astrafe)
- If $astrafe Then
- Return performaction(145, 24)
- Else
- Return performaction(145, 26)
- EndIf
- EndFunc
- Func straferight($astrafe)
- If $astrafe Then
- Return performaction(146, 24)
- Else
- Return performaction(146, 26)
- EndIf
- EndFunc
- Func toggleautorun()
- Return performaction(183, 24)
- EndFunc
- Func reversedirection()
- Return performaction(177, 24)
- EndFunc
- #EndRegion Movement
- #Region Travel
- Func travelto($amapid, $adis = 0)
- If getmapid() = $amapid AND $adis = 0 AND getmaploading() = 0 Then Return True
- zonemap($amapid, $adis)
- Return waitmaploading($amapid)
- EndFunc
- Func zonemap($amapid, $adistrict = 0)
- movemap($amapid, getregion(), $adistrict, getlanguage())
- EndFunc
- Func movemap($amapid, $aregion, $adistrict, $alanguage)
- Return sendpacket(24, 170, $amapid, $aregion, $adistrict, $alanguage, False)
- EndFunc
- Func returntooutpost()
- Return sendpacket(4, 160)
- EndFunc
- Func enterchallenge()
- Return sendpacket(8, 158, 1)
- EndFunc
- Func enterchallengeforeign()
- Return sendpacket(8, 158, 0)
- EndFunc
- Func travelgh()
- Local $loffset[3] = [0, 24, 60]
- Local $lgh = memoryreadptr($mbasepointer, $loffset)
- sendpacket(24, 169, memoryread($lgh[1] + 100), memoryread($lgh[1] + 104), memoryread($lgh[1] + 108), memoryread($lgh[1] + 112), 1)
- Return waitmaploading()
- EndFunc
- Func leavegh()
- sendpacket(8, 171, 1)
- Return waitmaploading()
- EndFunc
- #EndRegion Travel
- #Region Quest
- Func acceptquest($aquestid)
- Return sendpacket(8, 52, "0x008" & Hex($aquestid, 3) & "01")
- EndFunc
- Func questreward($aquestid)
- Return sendpacket(8, 52, "0x008" & Hex($aquestid, 3) & "07")
- EndFunc
- Func abandonquest($aquestid)
- Return sendpacket(8, 9, $aquestid)
- EndFunc
- #EndRegion Quest
- #Region Windows
- Func closeallpanels()
- Return performaction(133, 24)
- EndFunc
- Func toggleherowindow()
- Return performaction(138, 24)
- EndFunc
- Func toggleinventory()
- Return performaction(139, 24)
- EndFunc
- Func toggleallbags()
- Return performaction(184, 24)
- EndFunc
- Func toggleworldmap()
- Return performaction(140, 24)
- EndFunc
- Func toggleoptions()
- Return performaction(141, 24)
- EndFunc
- Func togglequestwindow()
- Return performaction(142, 24)
- EndFunc
- Func toggleskillwindow()
- Return performaction(143, 24)
- EndFunc
- Func togglemissionmap()
- Return performaction(182, 24)
- EndFunc
- Func togglefriendlist()
- Return performaction(185, 24)
- EndFunc
- Func toggleguildwindow()
- Return performaction(186, 24)
- EndFunc
- Func togglepartywindow()
- Return performaction(191, 24)
- EndFunc
- Func togglescorechart()
- Return performaction(189, 24)
- EndFunc
- Func togglelayoutwindow()
- Return performaction(193, 24)
- EndFunc
- Func toggleminionlist()
- Return performaction(194, 24)
- EndFunc
- Func toggleheropanel($ahero)
- If $ahero < 4 Then
- Return performaction(219 + $ahero, 24)
- ElseIf $ahero < 8 Then
- Return performaction(254 + $ahero, 24)
- EndIf
- EndFunc
- Func toggleheropetpanel($ahero)
- If $ahero < 4 Then
- Return performaction(223 + $ahero, 24)
- ElseIf $ahero < 8 Then
- Return performaction(250 + $ahero, 24)
- EndIf
- EndFunc
- Func togglepetpanel()
- Return performaction(223, 24)
- EndFunc
- Func togglehelpwindow()
- Return performaction(228, 24)
- EndFunc
- #EndRegion Windows
- #Region Targeting
- Func changetarget($aagent)
- Local $lagentid
- If IsDllStruct($aagent) = 0 Then
- $lagentid = convertid($aagent)
- Else
- $lagentid = DllStructGetData($aagent, "ID")
- EndIf
- DllStructSetData($mchangetarget, 2, $lagentid)
- enqueue($mchangetargetptr, 8)
- EndFunc
- Func calltarget($atarget)
- Local $ltargetid
- If IsDllStruct($atarget) = 0 Then
- $ltargetid = convertid($atarget)
- Else
- $ltargetid = DllStructGetData($atarget, "ID")
- EndIf
- Return sendpacket(12, 27, 10, $ltargetid)
- EndFunc
- Func cleartarget()
- Return performaction(227, 24)
- EndFunc
- Func targetnearestenemy()
- Return performaction(147, 24)
- EndFunc
- Func targetnextenemy()
- Return performaction(149, 24)
- EndFunc
- Func targetpartymember($anumber)
- If $anumber > 0 AND $anumber < 13 Then Return performaction(149 + $anumber, 24)
- EndFunc
- Func targetpreviousenemy()
- Return performaction(158, 24)
- EndFunc
- Func targetcalledtarget()
- Return performaction(159, 24)
- EndFunc
- Func targetself()
- Return performaction(160, 24)
- EndFunc
- Func targetnearestally()
- Return performaction(188, 24)
- EndFunc
- Func targetnearestitem()
- Return performaction(195, 24)
- EndFunc
- Func targetnextitem()
- Return performaction(196, 24)
- EndFunc
- Func targetpreviousitem()
- Return performaction(197, 24)
- EndFunc
- Func targetnextpartymember()
- Return performaction(202, 24)
- EndFunc
- Func targetpreviouspartymember()
- Return performaction(203, 24)
- EndFunc
- #EndRegion Targeting
- #Region Display
- Func enablerendering()
- memorywrite($mdenderingndering, 0)
- EndFunc
- Func disablerendering()
- memorywrite($mdenderingndering, 1)
- EndFunc
- Func displayall($adisplay)
- displayallies($adisplay)
- displayenemies($adisplay)
- EndFunc
- Func displayallies($adisplay)
- If $adisplay Then
- Return performaction(137, 24)
- Else
- Return performaction(137, 26)
- EndIf
- EndFunc
- Func displayenemies($adisplay)
- If $adisplay Then
- Return performaction(148, 24)
- Else
- Return performaction(148, 26)
- EndIf
- EndFunc
- #EndRegion Display
- #Region Chat
- Func writechat($amessage, $asender = "GWAІ")
- Local $lmessage, $lsender
- Local $laddress = 256 * $mqueuecounter + $mqueuebase
- If $mqueuecounter = $mqueuesize Then
- $mqueuecounter = 0
- Else
- $mqueuecounter = $mqueuecounter + 1
- EndIf
- If StringLen($asender) > 19 Then
- $lsender = StringLeft($asender, 19)
- Else
- $lsender = $asender
- EndIf
- memorywrite($laddress + 4, $lsender, "wchar[20]")
- If StringLen($amessage) > 100 Then
- $lmessage = StringLeft($amessage, 100)
- Else
- $lmessage = $amessage
- EndIf
- memorywrite($laddress + 44, $lmessage, "wchar[101]")
- DllCall($mkernelhandle, "int", "WrissMemorysMemory", "int", $mgwprochandle, "int", $laddress, "ptr", $mwritechatptr, "int", 4, "int", "")
- If StringLen($amessage) > 100 Then writechat(StringTrimLeft($amessage, 100), $asender)
- EndFunc
- Func sendwhisper($areceiver, $amessage)
- Local $ltotal = "whisper " & $areceiver & "," & $amessage
- Local $lmessage
- If StringLen($ltotal) > 120 Then
- $lmessage = StringLeft($ltotal, 120)
- Else
- $lmessage = $ltotal
- EndIf
- sendchat($lmessage, "/")
- If StringLen($ltotal) > 120 Then sendwhisper($areceiver, StringTrimLeft($ltotal, 120))
- EndFunc
- Func sendchat($amessage, $achannel = "!")
- Local $lmessage
- Local $laddress = 256 * $mqueuecounter + $mqueuebase
- If $mqueuecounter = $mqueuesize Then
- $mqueuecounter = 0
- Else
- $mqueuecounter = $mqueuecounter + 1
- EndIf
- If StringLen($amessage) > 120 Then
- $lmessage = StringLeft($amessage, 120)
- Else
- $lmessage = $amessage
- EndIf
- memorywrite($laddress + 8, $achannel & $lmessage, "wchar[122]")
- DllCall($mkernelhandle, "int", "WrissMemorysMemory", "int", $mgwprochandle, "int", $laddress, "ptr", $msendchatptr, "int", 8, "int", "")
- If StringLen($amessage) > 120 Then sendchat(StringTrimLeft($amessage, 120), $achannel)
- EndFunc
- #EndRegion Chat
- #Region Misc
- Func changeweaponset($aset)
- Return performaction(128 + $aset, 24)
- EndFunc
- Func useskill($askillslot, $atarget, $acalltarget = False)
- Local $ltargetid
- If IsDllStruct($atarget) = 0 Then
- $ltargetid = convertid($atarget)
- Else
- $ltargetid = DllStructGetData($atarget, "ID")
- EndIf
- DllStructSetData($museskill, 2, $askillslot)
- DllStructSetData($museskill, 3, $ltargetid)
- DllStructSetData($museskill, 4, $acalltarget)
- enqueue($museskillptr, 16)
- EndFunc
- Func cancelaction()
- Return sendpacket(4, 33)
- EndFunc
- Func actioninteract()
- Return performaction(128, 24)
- EndFunc
- Func actionfollow()
- Return performaction(204, 24)
- EndFunc
- Func dropbundle()
- Return performaction(205, 24)
- EndFunc
- Func clearpartycommands()
- Return performaction(219, 24)
- EndFunc
- Func suppressaction($asuppress)
- If $asuppress Then
- Return performaction(208, 24)
- Else
- Return performaction(208, 26)
- EndIf
- EndFunc
- Func openchest()
- Return sendpacket(8, 76, 2)
- EndFunc
- Func dropbuff($askillid, $aagentid, $aheronumber = 0)
- Local $lbuffstruct = DllStructCreate("long SkillId;byte unknown1[4];loITargetITargetITargetId")
- Local $lbuffcount = getbuffcount($aheronumber)
- Local $lbutaddressaddress
- Local $loffset[4]
- $loffset[0] = 0
- $loffset[1] = 24
- $loffset[2] = 44
- $loffset[3] = 1296
- Local $lcount = memoryreadptr($mbasepointer, $loffset)
- ReDim $loffset[5]
- $loffset[3] = 1288
- Local $lbuffer
- For $i = 0 To $lcount[1] - 1
- $loffset[4] = 36 * $i
- $lbuffer = memoryreadptr($mbasepointer, $loffset)
- If $lbuffer[1] == getheroid($aheronumber) Then
- $loffset[4] = 4 + 36 * $i
- ReDim $loffset[6]
- For $j = 0 To $lbuffcount - 1
- $loffset[5] = 0 + 16 * $j
- $lbutaddressaddress = memoryreadptr($mbasepointer, $loffset)
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $lbutaddressaddress[0], "ptr", DllStructGetPtr($lbuffstruct), "int", DllStructGetSize($lbuffstruct), "int", "")
- If (DllStructGetData($lbuffstruct, "SkillID") == $askillid) AND (DllStructGetData($lbuffstruct, "TargetId") == convertid($aagentid)) Then
- Return sendpacket(8, 34, DllStructGetData($lbuffstruct, "BuffId"))
- ExitLoop 2
- EndIf
- Next
- EndIf
- Next
- EndFunc
- Func makescreenshot()
- Return performaction(174, 24)
- EndFunc
- Func inviteplayer($aplayername)
- sendchat("invite " & $aplayername, "/")
- EndFunc
- Func leavegroup($akickheroes = True)
- If $akickheroes Then kickallheroes()
- Return sendpacket(4, 155)
- EndFunc
- Func switchmode($amode)
- Return sendpacket(8, 148, $amode)
- EndFunc
- Func resign()
- sendchat("resign", "/")
- EndFunc
- Func donatefaction($afaction)
- If StringLeft($afaction, 1) = "k" Then
- Return sendpacket(16, 46, 0, 0, 5000)
- Else
- Return sendpacket(16, 46, 0, 1, 5000)
- EndIf
- EndFunc
- Func dialog($adialogid)
- Return sendpacket(8, 52, $adialogid)
- EndFunc
- Func skipcinematic()
- Return sendpacket(4, 92)
- EndFunc
- Func setskillbarskill($aslot, $askillid, $aheronumber = 0)
- Return sendpacket(20, 84, getheroid($aheronumber), $aslot - 1, $askillid, 0)
- EndFunc
- Func loadskillbar($askill1 = 0, $askill2 = 0, $askill3 = 0, $askill4 = 0, $askill5 = 0, $askill6 = 0, $askill7 = 0, $askill8 = 0, $aheronumber = 0)
- sendpacket(44, 85, getheroid($aheronumber), 8, $askill1, $askill2, $askill3, $askill4, $askill5, $askill6, $askill7, $askill8)
- EndFunc
- Func loadskilltemplate($atemplate, $aheronumber = 0)
- Local $lheroid = getheroid($aheronumber)
- Local $lsplittemplate = StringSplit($atemplate, "")
- Local $ltemplatetype
- Local $lversionnumber
- Local $lprofbits
- Local $lprofprimary
- Local $lprofsecondary
- Local $lattributescount
- Local $lattributesbits
- Local $lattributes[1][2]
- Local $lskillsbits
- Local $lskills[8]
- Local $loptail
- $atemplate = ""
- For $i = 1 To $lsplittemplate[0]
- $atemplate &= base64tobin64($lsplittemplate[$i])
- Next
- $ltemplatetype = bin64todec(StringLeft($atemplate, 4))
- $atemplate = StringTrimLeft($atemplate, 4)
- If $ltemplatetype <> 14 Then Return False
- $lversionnumber = bin64todec(StringLeft($atemplate, 4))
- $atemplate = StringTrimLeft($atemplate, 4)
- $lprofbits = bin64todec(StringLeft($atemplate, 2)) * 2 + 4
- $atemplate = StringTrimLeft($atemplate, 2)
- $lprofprimary = bin64todec(StringLeft($atemplate, $lprofbits))
- $atemplate = StringTrimLeft($atemplate, $lprofbits)
- If $lprofprimary <> getheroprofession($aheronumber) Then Return False
- $lprofsecondary = bin64todec(StringLeft($atemplate, $lprofbits))
- $atemplate = StringTrimLeft($atemplate, $lprofbits)
- $lattributescount = bin64todec(StringLeft($atemplate, 4))
- $atemplate = StringTrimLeft($atemplate, 4)
- $lattributesbits = bin64todec(StringLeft($atemplate, 4)) + 4
- $atemplate = StringTrimLeft($atemplate, 4)
- $lattributes[0][0] = $lattributescount
- For $i = 1 To $lattributescount
- If bin64todec(StringLeft($atemplate, $lattributesbits)) == getprofprimaryattribute($lprofprimary) Then
- $atemplate = StringTrimLeft($atemplate, $lattributesbits)
- $lattributes[0][1] = bin64todec(StringLeft($atemplate, 4))
- $atemplate = StringTrimLeft($atemplate, 4)
- ContinueLoop
- EndIf
- $lattributes[0][0] += 1
- ReDim $lattributes[$lattributes[0][0] + 1][2]
- $lattributes[$i][0] = bin64todec(StringLeft($atemplate, $lattributesbits))
- $atemplate = StringTrimLeft($atemplate, $lattributesbits)
- $lattributes[$i][1] = bin64todec(StringLeft($atemplate, 4))
- $atemplate = StringTrimLeft($atemplate, 4)
- Next
- $lskillsbits = bin64todec(StringLeft($atemplate, 4)) + 8
- $atemplate = StringTrimLeft($atemplate, 4)
- For $i = 0 To 7
- $lskills[$i] = bin64todec(StringLeft($atemplate, $lskillsbits))
- $atemplate = StringTrimLeft($atemplate, $lskillsbits)
- Next
- $loptail = bin64todec($atemplate)
- $lattributes[0][0] = $lprofsecondary
- loadattributes($lattributes, $aheronumber)
- loadskillbar($lskills[0], $lskills[1], $lskills[2], $lskills[3], $lskills[4], $lskills[5], $lskills[6], $lskills[7], $aheronumber)
- EndFunc
- Func loadattributes($aattributesarray, $aheronumber = 0)
- Local $lpttributetribute
- Local $ldeadlock
- Local $lheroid = getheroid($aheronumber)
- Local $llevel
- $lpttributetribute = getprofprimaryattribute(getheroprofession($aheronumber))
- If $aattributesarray[0][0] <> 0 AND getheroprofession($aheronumber, True) <> $aattributesarray[0][0] AND getheroprofession($aheronumber) <> $aattributesarray[0][0] Then
- Do
- $ldeadlock = TimerInit()
- changesecondprofession($aattributesarray[0][0], $aheronumber)
- Do
- Sleep(20)
- Until getheroprofession($aheronumber, True) == $aattributesarray[0][0] OR TimerDiff($ldeadlock) > 5000
- Until getheroprofession($aheronumber, True) == $aattributesarray[0][0]
- EndIf
- $aattributesarray[0][0] = $lpttributetribute
- For $i = 0 To UBound($aattributesarray) - 1
- If $aattributesarray[$i][1] > 12 Then $aattributesarray[$i][1] = 12
- If $aattributesarray[$i][1] < 0 Then $aattributesarray[$i][1] = 0
- Next
- While getattributebyid($lpttributetribute, False, $aheronumber) > $aattributesarray[0][1]
- $llevel = getattributebyid($lpttributetribute, False, $aheronumber)
- $ldeadlock = TimerInit()
- decreaseattribute($lpttributetribute, $aheronumber)
- Do
- Sleep(20)
- Until getattributebyid($lpttributetribute, False, $aheronumber) < $llevel OR TimerDiff($ldeadlock) > 5000
- tolsleep()
- WEnd
- For $i = 1 To UBound($aattributesarray) - 1
- While getattributebyid($aattributesarray[$i][0], False, $aheronumber) > $aattributesarray[$i][1]
- $llevel = getattributebyid($aattributesarray[$i][0], False, $aheronumber)
- $ldeadlock = TimerInit()
- decreaseattribute($aattributesarray[$i][0], $aheronumber)
- Do
- Sleep(20)
- Until getattributebyid($aattributesarray[$i][0], False, $aheronumber) < $llevel OR TimerDiff($ldeadlock) > 5000
- tolsleep()
- WEnd
- Next
- For $i = 0 To 44
- If getattributebyid($i, False, $aheronumber) > 0 Then
- If $i = $lpttributetribute Then ContinueLoop
- For $j = 1 To UBound($aattributesarray) - 1
- If $i = $aattributesarray[$j][0] Then ContinueLoop 2
- Local $ldummy
- Next
- While getattributebyid($i, False, $aheronumber) > 0
- $llevel = getattributebyid($i, False, $aheronumber)
- $ldeadlock = TimerInit()
- decreaseattribute($i, $aheronumber)
- Do
- Sleep(20)
- Until getattributebyid($i, False, $aheronumber) < $llevel OR TimerDiff($ldeadlock) > 5000
- tolsleep()
- WEnd
- EndIf
- Next
- While getattributebyid($lpttributetribute, False, $aheronumber) < $aattributesarray[0][1]
- $llevel = getattributebyid($lpttributetribute, False, $aheronumber)
- $ldeadlock = TimerInit()
- increaseattribute($lpttributetribute, $aheronumber)
- Do
- Sleep(20)
- Until getattributebyid($lpttributetribute, False, $aheronumber) > $llevel OR TimerDiff($ldeadlock) > 5000
- tolsleep()
- WEnd
- For $i = 1 To UBound($aattributesarray) - 1
- While getattributebyid($aattributesarray[$i][0], False, $aheronumber) < $aattributesarray[$i][1]
- $llevel = getattributebyid($aattributesarray[$i][0], False, $aheronumber)
- $ldeadlock = TimerInit()
- increaseattribute($aattributesarray[$i][0], $aheronumber)
- Do
- Sleep(20)
- Until getattributebyid($aattributesarray[$i][0], False, $aheronumber) > $llevel OR TimerDiff($ldeadlock) > 5000
- tolsleep()
- WEnd
- Next
- EndFunc
- Func increaseattribute($aattributeid, $aheronumber = 0)
- DllStructSetData($minttributetribute, 2, $aattributeid)
- DllStructSetData($minttributetribute, 3, getheroid($aheronumber))
- enqueue($mincreibuteptrbuteptr, 12)
- EndFunc
- Func decreaseattribute($aattributeid, $aheronumber = 0)
- DllStructSetData($mdettributetribute, 2, $aattributeid)
- DllStructSetData($mdettributetribute, 3, getheroid($aheronumber))
- enqueue($mdecreibuteptrbuteptr, 12)
- EndFunc
- Func clearattributes($aheronumber = 0)
- Local $llevel
- If getmaploading() <> 0 Then Return
- For $i = 0 To 44
- If getattributebyid($i, False, $aheronumber) > 0 Then
- Do
- $llevel = getattributebyid($i, False, $aheronumber)
- $ldeadlock = TimerInit()
- decreaseattribute($i, $aheronumber)
- Do
- Sleep(20)
- Until $llevel > getattributebyid($i, False, $aheronumber) OR TimerDiff($ldeadlock) > 5000
- Sleep(100)
- Until getattributebyid($i, False, $aheronumber) == 0
- EndIf
- Next
- EndFunc
- Func changesecondprofession($aprofession, $aheronumber = 0)
- Return sendpacket(12, 58, getheroid($aheronumber), $aprofession)
- EndFunc
- Func initmapload()
- memorywrite($mmapisloaded, 0)
- EndFunc
- Func ensureenglish($aensure)
- If $aensure Then
- memorywrite($mensureenglish, 1)
- Else
- memorywrite($mensureenglish, 0)
- EndIf
- EndFunc
- Func togglelanguage()
- DllStructSetData($mtogglelanguage, 2, 24)
- enqueue($mtoguageptruageptr, 8)
- EndFunc
- Func changemaxzoom($azoom = 750)
- memorywrite($mzoomstill, $azoom, "float")
- memorywrite($mzoommoving, $azoom, "float")
- EndFunc
- Func clearmemory()
- DllCall($mkernelhandle, "int", "SetProcesgSetSizgSetSize", "int", $mgwprochandle, "int", -1, "int", -1)
- EndFunc
- Func setmaxmemory($amemory = 157286400)
- DllCall($mkernelhandle, "int", "SetProcessWetSizeEetSizeEx", "int", $mgwprochandle, "int", 1, "int", $amemory, "int", 6)
- EndFunc
- #EndRegion Misc
- Func enqueue($aptr, $asize)
- DllCall($mkernelhandle, "int", "WrissMemorysMemory", "int", $mgwprochandle, "int", 256 * $mqueuecounter + $mqueuebase, "ptr", $aptr, "int", $asize, "int", "")
- If $mqueuecounter = $mqueuesize Then
- $mqueuecounter = 0
- Else
- $mqueuecounter = $mqueuecounter + 1
- EndIf
- EndFunc
- Func floattoint($nfloat)
- Local $tfloat = DllStructCreate("float")
- Local $tint = DllStructCreate("int", DllStructGetPtr($tfloat))
- DllStructSetData($tfloat, 1, $nfloat)
- Return DllStructGetData($tint, 1)
- EndFunc
- #EndRegion Commands
- #Region Queries
- #Region Titles
- Func getherotitle()
- Local $loffset[5] = [0, 24, 44, 2076, 4]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getgladiatortitle()
- Local $loffset[5] = [0, 24, 44, 2076, 124]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getkurzicktitle()
- Local $loffset[5] = [0, 24, 44, 2076, 204]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getluxontitle()
- Local $loffset[5] = [0, 24, 44, 2076, 244]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getdrunkardtitle()
- Local $loffset[5] = [0, 24, 44, 2076, 284]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getsurvivortitle()
- Local $loffset[5] = [0, 24, 44, 2076, 364]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getmaxtitles()
- Local $loffset[5] = [0, 24, 44, 2076, 404]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getluckytitle()
- Local $loffset[5] = [0, 24, 44, 2076, 604]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getunluckytitle()
- Local $loffset[5] = [0, 24, 44, 2076, 644]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getsunspeartitle()
- Local $loffset[5] = [0, 24, 44, 2076, 684]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getlightbringertitle()
- Local $loffset[5] = [0, 24, 44, 2076, 804]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getcommandertitle()
- Local $loffset[5] = [0, 24, 44, 2076, 884]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getgamertitle()
- Local $loffset[5] = [0, 24, 44, 2076, 924]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getlegendaryguardiantitle()
- Local $loffset[5] = [0, 24, 44, 2076, 1244]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getsweettitle()
- Local $loffset[5] = [0, 24, 44, 2076, 1364]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getasuratitle()
- Local $loffset[5] = [0, 24, 44, 2076, 1524]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getdeldrimortitle()
- Local $loffset[5] = [0, 24, 44, 2076, 1564]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getvanguardtitle()
- Local $loffset[5] = [0, 24, 44, 2076, 1604]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getnorntitle()
- Local $loffset[5] = [0, 24, 44, 2076, 1644]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getnorthmasterytitle()
- Local $loffset[5] = [0, 24, 44, 2076, 1684]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getpartytitle()
- Local $loffset[5] = [0, 24, 44, 2076, 1724]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getzaishentitle()
- Local $loffset[5] = [0, 24, 44, 2076, 1764]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func gettreasuretitle()
- Local $loffset[5] = [0, 24, 44, 2076, 1804]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getwisdomtitle()
- Local $loffset[5] = [0, 24, 44, 2076, 1844]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- #EndRegion Titles
- #Region Faction
- Func getkurzickfaction()
- Local $loffset[4] = [0, 24, 44, 1864]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getmaxkurzickfaction()
- Local $loffset[4] = [0, 24, 44, 1976]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getluxonfaction()
- Local $loffset[4] = [0, 24, 44, 1880]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getmaxluxonfaction()
- Local $loffset[4] = [0, 24, 44, 1980]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getbalthazarfaction()
- Local $loffset[4] = [0, 24, 44, 1944]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getmaxbalthazarfaction()
- Local $loffset[4] = [0, 24, 44, 1984]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getimperialfaction()
- Local $loffset[4] = [0, 24, 44, 1900]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getmaximperialfaction()
- Local $loffset[4] = [0, 24, 44, 1988]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- #EndRegion Faction
- #Region Item
- Func getrarity($aitem)
- If NOT IsDllStruct($aitem) Then $aitem = getitembyitemid($aitem)
- Local $lptr = DllStructGetData($aitem, "NameString")
- If $lptr == 0 Then Return
- Return memoryread($lptr, "ushort")
- EndFunc
- Func getisided($aitem)
- If NOT IsDllStruct($aitem) Then $aitem = getitembyitemid($aitem)
- Return BitAND(DllStructGetData($aitem, "interaction"), 1) > 0
- EndFunc
- Func getitemreq($aitem)
- Local $lmod = getmodbyidentifier($aitem, "9827")
- Return $lmod[0]
- EndFunc
- Func getitemattribute($aitem)
- Local $lmod = getmodbyidentifier($aitem, "9827")
- Return $lmod[1]
- EndFunc
- Func getmodbyidentifier($aitem, $aidentifier)
- If NOT IsDllStruct($aitem) Then $aitem = getitembyitemid($aitem)
- Local $lreturn[2]
- Local $lstring = StringTrimLeft(getmodstruct($aitem), 2)
- For $i = 0 To StringLen($lstring) / 8 - 2
- If StringMid($lstring, 8 * $i + 5, 4) == $aidentifier Then
- $lreturn[0] = Int("0x" & StringMid($lstring, 8 * $i + 1, 2))
- $lreturn[1] = Int("0x" & StringMid($lstring, 8 * $i + 3, 2))
- ExitLoop
- EndIf
- Next
- Return $lreturn
- EndFunc
- Func getmodstruct($aitem)
- If NOT IsDllStruct($aitem) Then $aitem = getitembyitemid($aitem)
- If DllStructGetData($aitem, "modstruct") = 0 Then Return
- Return memoryread(DllStructGetData($aitem, "modstruct"), "Byte[" & DllStructGetData($aitem, "modstructsize") * 4 & "]")
- EndFunc
- Func getassignedtome($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return (DllStructGetData($aagent, "Owner") = getmyid())
- EndFunc
- Func getcanpickup($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- If getassignedtome($aagent) OR DllStructGetData($aagent, "Owner") = 0 Then
- Return True
- Else
- Return False
- EndIf
- EndFunc
- Func getbag($abag)
- Local $loffset[5] = [0, 24, 64, 248, 4 * $abag]
- Local $lbagstruct = DllStructCreate("byte 1[4];long index;longex;long id;ptr containerItem;long ItemsCount;ptr bagArray;mArray;loSng sloSng sloSng slotng slots")
- Local $lbagptr = memoryreadptr($mbasepointer, $loffset)
- If $lbagptr[1] = 0 Then Return
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $lbagptr[1], "ptr", DllStructGetPtr($lbagstruct), "int", DllStructGetSize($lbagstruct), "int", "")
- Return $lbagstruct
- EndFunc
- Func getitembyslot($abag, $aslot)
- Local $lbag
- If IsDllStruct($abag) = 0 Then
- $lbag = getbag($abag)
- Else
- $lbag = $abag
- EndIf
- Local $litemptr = DllStructGetData($lbag, "ItemArray")
- Local $lbuffer = DllStructCreate("ptr")
- Local $litemstruct = DllStructCreate("long agentId;byte unknow unknown1[4];ptr bag;ptr modstruct;long modstructsize;ptr customized;byte unknown2[4];byte type;byte unknown3;short extraId;short value;byte unknown4[2];short interaction;long modelId;ptr modString;byte unknown5[4];ptr NameString;byte unknown6[15];byte quantity;bipped;bytwyte slwyte sloyte slotte slot")
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", DllStructGetData($lbag, "ItemArray") + 4 * ($aslot - 1), "ptr", DllStructGetPtr($lbuffer), "int", DllStructGetSize($lbuffer), "int", "")
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", DllStructGetData($lbuffer, 1), "ptr", DllStructGetPtr($litemstruct), "int", DllStructGetSize($litemstruct), "int", "")
- Return $litemstruct
- EndFunc
- Func getitembyitemid($aitemid)
- Local $litemstruct = DllStructCreate("long agentId;byte unknow unknown1[4];ptr bag;ptr modstruct;long modstructsize;ptr customized;byte unknown2[4];byte type;byte unknown3;short extraId;short value;byte unknown4[2];short interaction;long modelId;ptr modString;byte unknown5[4];ptr NameString;byte unknown6[15];byte quantity;bipped;bytwyte slwyte sloyte slotte slot")
- Local $loffset[5] = [0, 24, 64, 184, 4 * $aitemid]
- Local $litemptr = memoryreadptr($mbasepointer, $loffset)
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $litemptr[1], "ptr", DllStructGetPtr($litemstruct), "int", DllStructGetSize($litemstruct), "int", "")
- Return $litemstruct
- EndFunc
- Func getitembyagentid($aagentid)
- Local $litemstruct = DllStructCreate("long agentId;byte unknow unknown1[4];ptr bag;ptr modstruct;long modstructsize;ptr customized;byte unknown2[4];byte type;byte unknown3;short extraId;short value;byte unknown4[2];short interaction;long modelId;ptr modString;byte unknown5[4];ptr NameString;byte unknown6[15];byte quantity;bipped;bytwyte slwyte sloyte slotte slot")
- Local $loffset[4] = [0, 24, 64, 192]
- Local $litemarraysize = memoryreadptr($mbasepointer, $loffset)
- Local $loffset[5] = [0, 24, 64, 184, 0]
- Local $litemptr, $litemid
- Local $lagentid = convertid($aagentid)
- For $litemid = 1 To $litemarraysize[1]
- $loffset[4] = 4 * $litemid
- $litemptr = memoryreadptr($mbasepointer, $loffset)
- If $litemptr[1] = 0 Then ContinueLoop
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $litemptr[1], "ptr", DllStructGetPtr($litemstruct), "int", DllStructGetSize($litemstruct), "int", "")
- If DllStructGetData($litemstruct, "AgentID") = $lagentid Then Return $litemstruct
- Next
- EndFunc
- Func getitembymodelid($amodelid)
- Local $litemstruct = DllStructCreate("long agentId;byte unknow unknown1[4];ptr bag;ptr modstruct;long modstructsize;ptr customized;byte unknown2[4];byte type;byte unknown3;short extraId;short value;byte unknown4[2];short interaction;long modelId;ptr modString;byte unknown5[4];ptr NameString;byte unknown6[15];byte quantity;bipped;bytwyte slwyte sloyte slotte slot")
- Local $loffset[4] = [0, 24, 64, 192]
- Local $litemarraysize = memoryreadptr($mbasepointer, $loffset)
- Local $loffset[5] = [0, 24, 64, 184, 0]
- Local $litemptr, $litemid
- For $litemid = 1 To $litemarraysize[1]
- $loffset[4] = 4 * $litemid
- $litemptr = memoryreadptr($mbasepointer, $loffset)
- If $litemptr[1] = 0 Then ContinueLoop
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $litemptr[1], "ptr", DllStructGetPtr($litemstruct), "int", DllStructGetSize($litemstruct), "int", "")
- If DllStructGetData($litemstruct, "ModelID") = $amodelid Then Return $litemstruct
- Next
- EndFunc
- Func getgoldstorage()
- Local $loffset[5] = [0, 24, 64, 248, 128]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getgoldcharacter()
- Local $loffset[5] = [0, 24, 64, 248, 124]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func findsalvagekit()
- Local $litem
- Local $lkit = 0
- Local $luses = 101
- For $i = 1 To 16
- For $j = 1 To DllStructGetData(getbag($i), "Slots")
- $litem = getitembyslot($i, $j)
- Switch DllStructGetData($litem, "ModelID")
- Case 2991
- If DllStructGetData($litem, "Value") / 8 < $luses Then
- $lkit = DllStructGetData($litem, "ID")
- $luses = DllStructGetData($litem, "Value") / 8
- EndIf
- Case 5900
- If DllStructGetData($litem, "Value") / 10 < $luses Then
- $lkit = DllStructGetData($litem, "ID")
- $luses = DllStructGetData($litem, "Value") / 10
- EndIf
- Case Else
- ContinueLoop
- EndSwitch
- Next
- Next
- Return $lkit
- EndFunc
- Func findidkit()
- Local $litem
- Local $lkit = 0
- Local $luses = 101
- For $i = 1 To 16
- For $j = 1 To DllStructGetData(getbag($i), "Slots")
- $litem = getitembyslot($i, $j)
- Switch DllStructGetData($litem, "ModelID")
- Case 2989
- If DllStructGetData($litem, "Value") / 2 < $luses Then
- $lkit = DllStructGetData($litem, "ID")
- $luses = DllStructGetData($litem, "Value") / 2
- EndIf
- Case 5899
- If DllStructGetData($litem, "Value") / 2.5 < $luses Then
- $lkit = DllStructGetData($litem, "ID")
- $luses = DllStructGetData($litem, "Value") / 2.5
- EndIf
- Case Else
- ContinueLoop
- EndSwitch
- Next
- Next
- Return $lkit
- EndFunc
- Func gettradercostid()
- Return memoryread($mtradercostid)
- EndFunc
- Func gettradercostvalue()
- Return memoryread($mtradercostvalue)
- EndFunc
- Func getmerchantitemsbase()
- Local $loffset[4] = [0, 24, 44, 36]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getmerchantitemssize()
- Local $loffset[4] = [0, 24, 44, 40]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- #EndRegion Item
- #Region H&H
- Func getherocount()
- Local $loffset[5]
- $loffset[0] = 0
- $loffset[1] = 24
- $loffset[2] = 76
- $loffset[3] = 84
- $loffset[4] = 44
- Local $lherocount = memoryreadptr($mbasepointer, $loffset)
- Return $lherocount[1]
- EndFunc
- Func getheroid($aheronumber)
- If $aheronumber == 0 Then Return getmyid()
- Local $loffset[6]
- $loffset[0] = 0
- $loffset[1] = 24
- $loffset[2] = 76
- $loffset[3] = 84
- $loffset[4] = 36
- $loffset[5] = 24 * ($aheronumber - 1)
- Local $lagentid = memoryreadptr($mbasepointer, $loffset)
- Return $lagentid[1]
- EndFunc
- Func getheronumberbyagentid($aagentid)
- Local $lagentid
- Local $loffset[6]
- $loffset[0] = 0
- $loffset[1] = 24
- $loffset[2] = 76
- $loffset[3] = 84
- $loffset[4] = 36
- For $i = 1 To getherocount()
- $loffset[5] = 24 * ($i - 1)
- $lagentid = memoryreadptr($mbasepointer, $loffset)
- If $lagentid[1] == convertid($aagentid) Then Return $i
- Next
- Return 0
- EndFunc
- Func getheronumberbyheroid($aheroid)
- Local $lagentid
- Local $loffset[6]
- $loffset[0] = 0
- $loffset[1] = 24
- $loffset[2] = 76
- $loffset[3] = 84
- $loffset[4] = 36
- For $i = 1 To getherocount()
- $loffset[5] = 8 + 24 * ($i - 1)
- $lagentid = memoryreadptr($mbasepointer, $loffset)
- If $lagentid[1] == convertid($aheroid) Then Return $i
- Next
- Return 0
- EndFunc
- Func getheroprofession($aheronumber, $asecondary = False)
- Local $loffset[5] = [0, 24, 44, 1724, 0]
- Local $lbuffer
- $aheronumber = getheroid($aheronumber)
- For $i = 0 To getherocount()
- $lbuffer = memoryreadptr($mbasepointer, $loffset)
- If $lbuffer[1] = $aheronumber Then
- $loffset[4] += 4
- If $asecondary Then $loffset[4] += 4
- $lbuffer = memoryreadptr($mbasepointer, $loffset)
- Return $lbuffer[1]
- EndIf
- $loffset[4] += 20
- Next
- EndFunc
- Func getisheroskillslotdisabled($aheronumber, $askillslot)
- Return BitAND(2 ^ ($askillslot - 1), DllStructGetData(getskillbar($aheronumber), "Disabled")) > 0
- EndFunc
- #EndRegion H&H
- #Region Agent
- Func getagentbyid($aagentid = -2)
- Local $lagentptr = getagentptr($aagentid)
- If $lagentptr = 0 Then Return 0
- Local $lagentstruct = DllStructCreate("ptr vyte unknown1[24];byt24];byte unknown2[4];ptr NextAgent;byte unknown3[8];long Id;float Z;byte unknown4[8];float BoxHoverWidth;float BoxHoverHeight;byte unknown5[8];float Rotation;byte unknown6[8];long NameProperties;byte unknown7[24];float X;float Y;byte unknown8[8];float NameTagX;float NameTagY;float NameTagZ;byte unknown9[12];long Type;float MoveX;float MoveY;byte unknown10[28];long Owner;byte unknown30[8];long ExtraType;byte unknown11[24];float AttackSpeed;float AttackSpeedModifier;word PlayerNumber;byte unknown12[6];ptr Equip;byte unknown13[10];byte Primary;byte Secondary;byte Level;byte Team;byte unknown14[6];float EnergyPips;byte unknown[4];float EnergyPercent;long MaxEnergy;byte unknown15[4];float HPPips;byte unknown16[4];float HP;long MaxHP;long Effects;byte unknown17[4];byte Hex;byte unknown18[18];long ModelState;long TypeMap;byte unknown19[16];long InSpiritRange;byte unknown20[16];long LoginNumber;float ModelMode;byte unknown21[4];long ModelAnimation;byte unknown22[32];byte LastStrike;byte Allegiance;word WeaponType;word Skill;byte unknown23[ WeaponItrndItemrndItemrndItemIndItemId")
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $lagentptr, "ptr", DllStructGetPtr($lagentstruct), "int", DllStructGetSize($lagentstruct), "int", "")
- Return $lagentstruct
- EndFunc
- Func getagentptr($aagentid)
- Local $loffset[3] = [0, 4 * convertid($aagentid), 0]
- Local $lagetaddressaddress = memoryreadptr($magentbase, $loffset)
- Return $lagetaddressaddress[0]
- EndFunc
- Func getagentexists($aagentid)
- Return (getagentptr($aagentid) > 0 AND $aagentid < getmaxagents())
- EndFunc
- Func gettarget($aagent)
- Local $lagentid
- If IsDllStruct($aagent) = 0 Then
- $lagentid = convertid($aagent)
- Else
- $lagentid = DllStructGetData($aagent, "ID")
- EndIf
- Return memoryread(getvalue("TargetLogBase") + 4 * $lagentid)
- EndFunc
- Func getagentbyplayername($aplayername)
- For $i = 1 To getmaxagents()
- If getplayername($i) = $aplayername Then
- Return getagentbyid($i)
- EndIf
- Next
- EndFunc
- Func getagentbyname($aname)
- If $musestringlog = False Then Return
- Local $lname, $laddress
- For $i = 1 To getmaxagents()
- $laddress = $mstringlogbase + 256 * $i
- $lname = memoryread($laddress, "wchar [128]")
- $lname = StringRegExpReplace($lname, "[<]{+)[>]{1})[>]{1}", "")
- If StringInStr($lname, $aname) > 0 Then Return getagentbyid($i)
- Next
- displayall(True)
- Sleep(100)
- displayall(False)
- displayall(True)
- Sleep(100)
- displayall(False)
- For $i = 1 To getmaxagents()
- $laddress = $mstringlogbase + 256 * $i
- $lname = memoryread($laddress, "wchar [128]")
- $lname = StringRegExpReplace($lname, "[<]{+)[>]{1})[>]{1}", "")
- If StringInStr($lname, $aname) > 0 Then Return getagentbyid($i)
- Next
- EndFunc
- Func getnearestagenttoagent($aagent = -2)
- Local $lnearestagent, $lnearestdistance = 100000000
- Local $ldistance
- Local $lagentarray = getagentarray()
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Local $lid = DllStructGetData($aagent, "ID")
- For $i = 1 To $lagentarray[0]
- $ldistance = (DllStructGetData($aagent, "X") - DllStructGetData($lagentarray[$i], "X")) ^ 2 + (DllStructGetData($aagent, "Y") - DllStructGetData($lagentarray[$i], "Y")) ^ 2
- If $ldistance < $lnearestdistance Then
- If DllStructGetData($lagentarray[$i], "ID") == $lid Then ContinueLoop
- $lnearestagent = $lagentarray[$i]
- $lnearestdistance = $ldistance
- EndIf
- Next
- SetExtended(Sqrt($lnearestdistance))
- Return $lnearestagent
- EndFunc
- Func getnearestenemytoagent($aagent = -2)
- Local $lnearestagent, $lnearestdistance = 100000000
- Local $ldistance
- Local $lagentarray = getagentarray(219)
- If NOT IsDllStruct($aagent) Then $aagent = getagentbyid($aagent)
- Local $lid = DllStructGetData($aagent, "ID")
- For $i = 1 To $lagentarray[0]
- $ldistance = (DllStructGetData($aagent, "X") - DllStructGetData($lagentarray[$i], "X")) ^ 2 + (DllStructGetData($aagent, "Y") - DllStructGetData($lagentarray[$i], "Y")) ^ 2
- If DllStructGetData($lagentarray[$i], "Allegiance") <> 3 Then ContinueLoop
- If DllStructGetData($lagentarray[$i], "HP") <= 0 Then ContinueLoop
- If BitAND(DllStructGetData($lagentarray[$i], "Effects"), 16) > 0 Then ContinueLoop
- $ldistance = (DllStructGetData($aagent, "X") - DllStructGetData($lagentarray[$i], "X")) ^ 2 + (DllStructGetData($aagent, "Y") - DllStructGetData($lagentarray[$i], "Y")) ^ 2
- If $ldistance < $lnearestdistance Then
- If DllStructGetData($lagentarray[$i], "ID") == $lid Then ContinueLoop
- $lnearestagent = $lagentarray[$i]
- $lnearestdistance = $ldistance
- EndIf
- Next
- SetExtended(Sqrt($lnearestdistance))
- Return $lnearestagent
- EndFunc
- Func getnearestagenttocoords($ax, $ay)
- Local $lnearestagent, $lnearestdistance = 100000000
- Local $ldistance
- Local $lagentarray = getagentarray()
- For $i = 1 To $lagentarray[0]
- $ldistance = ($ax - DllStructGetData($lagentarray[$i], "X")) ^ 2 + ($ay - DllStructGetData($lagentarray[$i], "Y")) ^ 2
- If $ldistance < $lnearestdistance Then
- $lnearestagent = $lagentarray[$i]
- $lnearestdistance = $ldistance
- EndIf
- Next
- SetExtended(Sqrt($lnearestdistance))
- Return $lnearestagent
- EndFunc
- Func getnearestsignposttoagent($aagent = -2)
- Local $lnearestagent, $lnearestdistance = 100000000
- Local $ldistance
- Local $lagentarray = getagentarray(512)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Local $lid = DllStructGetData($aagent, "ID")
- For $i = 1 To $lagentarray[0]
- $ldistance = (DllStructGetData($lagentarray[$i], "Y") - DllStructGetData($aagent, "Y")) ^ 2 + (DllStructGetData($lagentarray[$i], "X") - DllStructGetData($aagent, "X")) ^ 2
- If $ldistance < $lnearestdistance Then
- If DllStructGetData($lagentarray[$i], "ID") == $lid Then ContinueLoop
- $lnearestagent = $lagentarray[$i]
- $lnearestdistance = $ldistance
- EndIf
- Next
- SetExtended(Sqrt($lnearestdistance))
- Return $lnearestagent
- EndFunc
- Func getnearestsignposttocoords($ax, $ay)
- Local $lnearestagent, $lnearestdistance = 100000000
- Local $ldistance
- Local $lagentarray = getagentarray(512)
- For $i = 1 To $lagentarray[0]
- $ldistance = ($ax - DllStructGetData($lagentarray[$i], "X")) ^ 2 + ($ay - DllStructGetData($lagentarray[$i], "Y")) ^ 2
- If $ldistance < $lnearestdistance Then
- $lnearestagent = $lagentarray[$i]
- $lnearestdistance = $ldistance
- EndIf
- Next
- SetExtended(Sqrt($lnearestdistance))
- Return $lnearestagent
- EndFunc
- Func getnearestnpctoagent($aagent)
- Local $lnearestagent, $lnearestdistance = 100000000
- Local $ldistance
- Local $lagentarray = getagentarray(219)
- If NOT IsDllStruct($aagent) Then $aagent = getagentbyid($aagent)
- Local $lid = DllStructGetData($aagent, "ID")
- For $i = 1 To $lagentarray[0]
- If DllStructGetData($lagentarray[$i], "Allegiance") <> 6 Then ContinueLoop
- If DllStructGetData($lagentarray[$i], "HP") <= 0 Then ContinueLoop
- If BitAND(DllStructGetData($lagentarray[$i], "Effects"), 16) > 0 Then ContinueLoop
- $ldistance = (DllStructGetData($aagent, "X") - DllStructGetData($lagentarray[$i], "X")) ^ 2 + (DllStructGetData($aagent, "Y") - DllStructGetData($lagentarray[$i], "Y")) ^ 2
- If $ldistance < $lnearestdistance Then
- If DllStructGetData($lagentarray[$i], "ID") == $lid Then ContinueLoop
- $lnearestagent = $lagentarray[$i]
- $lnearestdistance = $ldistance
- EndIf
- Next
- SetExtended(Sqrt($lnearestdistance))
- Return $lnearestagent
- EndFunc
- Func getnearestnpctocoords($ax, $ay)
- Local $lnearestagent, $lnearestdistance = 100000000
- Local $ldistance
- Local $lagentarray = getagentarray(219)
- For $i = 1 To $lagentarray[0]
- If DllStructGetData($lagentarray[$i], "Allegiance") <> 6 Then ContinueLoop
- If DllStructGetData($lagentarray[$i], "HP") <= 0 Then ContinueLoop
- If BitAND(DllStructGetData($lagentarray[$i], "Effects"), 16) > 0 Then ContinueLoop
- $ldistance = ($ax - DllStructGetData($lagentarray[$i], "X")) ^ 2 + ($ay - DllStructGetData($lagentarray[$i], "Y")) ^ 2
- If $ldistance < $lnearestdistance Then
- $lnearestagent = $lagentarray[$i]
- $lnearestdistance = $ldistance
- EndIf
- Next
- SetExtended(Sqrt($lnearestdistance))
- Return $lnearestagent
- EndFunc
- Func getnearestitemtoagent($aagent = -2, $acanpickup = True)
- Local $lnearestagent, $lnearestdistance = 100000000
- Local $ldistance
- Local $lagentarray = getagentarray(1024)
- If NOT IsDllStruct($aagent) Then $aagent = getagentbyid($aagent)
- Local $lid = DllStructGetData($aagent, "ID")
- For $i = 1 To $lagentarray[0]
- If $acanpickup AND NOT getcanpickup($lagentarray[$i]) Then ContinueLoop
- $ldistance = (DllStructGetData($aagent, "X") - DllStructGetData($lagentarray[$i], "X")) ^ 2 + (DllStructGetData($aagent, "Y") - DllStructGetData($lagentarray[$i], "Y")) ^ 2
- If $ldistance < $lnearestdistance Then
- If DllStructGetData($lagentarray[$i], "ID") == $lid Then ContinueLoop
- $lnearestagent = $lagentarray[$i]
- $lnearestdistance = $ldistance
- EndIf
- Next
- SetExtended(Sqrt($lnearestdistance))
- Return $lnearestagent
- EndFunc
- Func getparty($aagentarray = 0)
- Local $lreturnarray[1] = [0]
- If $aagentarray == 0 Then $aagentarray = getagentarray(219)
- For $i = 1 To $aagentarray[0]
- If DllStructGetData($aagentarray[$i], "Allegiance") == 1 Then
- If BitAND(DllStructGetData($aagentarray[$i], "TypeMap"), 131072) Then
- $lreturnarray[0] += 1
- ReDim $lreturnarray[$lreturnarray[0] + 1]
- $lreturnarray[$lreturnarray[0]] = $aagentarray[$i]
- EndIf
- EndIf
- Next
- Return $lreturnarray
- EndFunc
- Func getagentarray($atype = 0)
- Local $lstruct
- Local $lcount
- Local $lbuffer = ""
- DllStructSetData($mmakeagentarray, 2, $atype)
- memorywrite($magentcopycount, -1, "long")
- enqueue($mmaarrayptrrrayptr, 8)
- Local $ldeadlock = TimerInit()
- Do
- Sleep(1)
- $lcount = memoryread($magentcopycount, "long")
- Until $lcount >= 0 OR TimerDiff($ldeadlock) > 5000
- If $lcount < 0 Then $lcount = 0
- For $i = 1 To $lcount
- $lbuffer &= "Byte[448];"
- Next
- $lbuffer = DllStructCreate($lbuffer)
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $magentcopybase, "ptr", DllStructGetPtr($lbuffer), "int", DllStructGetSize($lbuffer), "int", "")
- Local $lreturnarray[$lcount + 1] = [$lcount]
- For $i = 1 To $lcount
- $lreturnarray[$i] = DllStructCreate("ptr vyte unknown1[24];byt24];byte unknown2[4];ptr NextAgent;byte unknown3[8];long Id;float Z;byte unknown4[8];float BoxHoverWidth;float BoxHoverHeight;byte unknown5[8];float Rotation;byte unknown6[8];long NameProperties;byte unknown7[24];float X;float Y;byte unknown8[8];float NameTagX;float NameTagY;float NameTagZ;byte unknown9[12];long Type;float MoveX;float MoveY;byte unknown10[28];long Owner;byte unknown30[8];long ExtraType;byte unknown11[24];float AttackSpeed;float AttackSpeedModifier;word PlayerNumber;byte unknown12[6];ptr Equip;byte unknown13[10];byte Primary;byte Secondary;byte Level;byte Team;byte unknown14[6];float EnergyPips;byte unknown[4];float EnergyPercent;long MaxEnergy;byte unknown15[4];float HPPips;byte unknown16[4];float HP;long MaxHP;long Effects;byte unknown17[4];byte Hex;byte unknown18[18];long ModelState;long TypeMap;byte unknown19[16];long InSpiritRange;byte unknown20[16];long LoginNumber;float ModelMode;byte unknown21[4];long ModelAnimation;byte unknown22[32];byte LastStrike;byte Allegiance;word WeaponType;word Skill;byte unknown23[ WeaponItrndItemrndItemrndItemIndItemId")
- $lstruct = DllStructCreate("byte[448]", DllStructGetPtr($lreturnarray[$i]))
- DllStructSetData($lstruct, 1, DllStructGetData($lbuffer, $i))
- Next
- Return $lreturnarray
- EndFunc
- Func getpartydanger($aagentarray = 0, $aparty = 0)
- If $aagentarray == 0 Then $aagentarray = getagentarray(219)
- If $aparty == 0 Then $aparty = getparty($aagentarray)
- Local $lreturnarray[$aparty[0] + 1]
- $lreturnarray[0] = $aparty[0]
- For $i = 1 To $lreturnarray[0]
- $lreturnarray[$i] = 0
- Next
- For $i = 1 To $aagentarray[0]
- If BitAND(DllStructGetData($aagentarray[$i], "Effects"), 16) > 0 Then ContinueLoop
- If DllStructGetData($aagentarray[$i], "HP") <= 0 Then ContinueLoop
- If NOT getisliving($aagentarray[$i]) Then ContinueLoop
- If DllStructGetData($aagentarray[$i], "Allegiance") > 3 Then ContinueLoop
- For $j = 1 To $aparty[0]
- If gettarget(DllStructGetData($aagentarray[$i], "ID")) == DllStructGetData($aparty[$j], "ID") Then
- If getdistance($aagentarray[$i], $aparty[$j]) < 5000 Then
- If DllStructGetData($aagentarray[$i], "Team") <> 0 Then
- If DllStructGetData($aagentarray[$i], "Team") <> DllStructGetData($aparty[$j], "Team") Then
- $lreturnarray[$j] += 1
- EndIf
- ElseIf DllStructGetData($aagentarray[$i], "Allegiance") <> DllStructGetData($aparty[$j], "Allegiance") Then
- $lreturnarray[$j] += 1
- EndIf
- EndIf
- EndIf
- Next
- Next
- Return $lreturnarray
- EndFunc
- Func getagentdanger($aagent, $aagentarray = 0)
- If IsDllStruct($aagent) = 0 Then
- $aagent = getagentbyid($aagent)
- EndIf
- Local $lcount = 0
- If $aagentarray == 0 Then $aagentarray = getagentarray(219)
- For $i = 1 To $aagentarray[0]
- If BitAND(DllStructGetData($aagentarray[$i], "Effects"), 16) > 0 Then ContinueLoop
- If DllStructGetData($aagentarray[$i], "HP") <= 0 Then ContinueLoop
- If NOT getisliving($aagentarray[$i]) Then ContinueLoop
- If DllStructGetData($aagentarray[$i], "Allegiance") > 3 Then ContinueLoop
- If gettarget(DllStructGetData($aagentarray[$i], "ID")) == DllStructGetData($aagent, "ID") Then
- If getdistance($aagentarray[$i], $aagent) < 5000 Then
- If DllStructGetData($aagentarray[$i], "Team") <> 0 Then
- If DllStructGetData($aagentarray[$i], "Team") <> DllStructGetData($aagent, "Team") Then
- $lcount += 1
- EndIf
- ElseIf DllStructGetData($aagentarray[$i], "Allegiance") <> DllStructGetData($aagent, "Allegiance") Then
- $lcount += 1
- EndIf
- EndIf
- EndIf
- Next
- Return $lcount
- EndFunc
- #EndRegion Agent
- #Region AgentInfo
- Func getisliving($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return DllStructGetData($aagent, "Type") = 219
- EndFunc
- Func getisstatic($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return DllStructGetData($aagent, "Type") = 512
- EndFunc
- Func getismovable($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return DllStructGetData($aagent, "Type") = 1024
- EndFunc
- Func getenergy($aagent = -2)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return DllStructGetData($aagent, "EnergyPercent") * DllStructGetData($aagent, "MaxEnergy")
- EndFunc
- Func gethealth($aagent = -2)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return DllStructGetData($aagent, "HP") * DllStructGetData($aagent, "MaxHP")
- EndFunc
- Func getismoving($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- If DllStructGetData($aagent, "MoveX") <> 0 OR DllStructGetData($aagent, "MoveY") <> 0 Then Return True
- Return False
- EndFunc
- Func getisknocked($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return DllStructGetData($aagent, "ModelState") = 1104
- EndFunc
- Func getisattacking($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Switch DllStructGetData($aagent, "ModelState")
- Case 96
- Return True
- Case 1088
- Return True
- Case 1120
- Return True
- Case Else
- Return False
- EndSwitch
- EndFunc
- Func getiscasting($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return DllStructGetData($aagent, "Skill") <> 0
- EndFunc
- Func getisbleeding($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return BitAND(DllStructGetData($aagent, "Effects"), 1) > 0
- EndFunc
- Func gethascondition($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return BitAND(DllStructGetData($aagent, "Effects"), 2) > 0
- EndFunc
- Func getisdead($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return BitAND(DllStructGetData($aagent, "Effects"), 16) > 0
- EndFunc
- Func gethasdeepwound($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return BitAND(DllStructGetData($aagent, "Effects"), 32) > 0
- EndFunc
- Func getispoisoned($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return BitAND(DllStructGetData($aagent, "Effects"), 64) > 0
- EndFunc
- Func getisenchanted($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return BitAND(DllStructGetData($aagent, "Effects"), 128) > 0
- EndFunc
- Func gethasdegenhex($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return BitAND(DllStructGetData($aagent, "Effects"), 1024) > 0
- EndFunc
- Func gethashex($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return BitAND(DllStructGetData($aagent, "Effects"), 2048) > 0
- EndFunc
- Func gethasweaponspell($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return BitAND(DllStructGetData($aagent, "Effects"), 32768) > 0
- EndFunc
- Func getisboss($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Return BitAND(DllStructGetData($aagent, "TypeMap"), 1024) > 0
- EndFunc
- Func getplayername($aagent)
- If IsDllStruct($aagent) = 0 Then $aagent = getagentbyid($aagent)
- Local $llogin = DllStructGetData($aagent, "LoginNumber")
- Local $loffset[6] = [0, 24, 44, 2060, 76 * $llogin + 40, 0]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset, "wchar[30]")
- Return $lreturn[1]
- EndFunc
- Func getagentname($aagent)
- If $musestringlog = False Then Return
- If IsDllStruct($aagent) = 0 Then
- Local $lagentid = convertid($aagent)
- If $lagentid = 0 Then Return ""
- Else
- Local $lagentid = DllStructGetData($aagent, "ID")
- EndIf
- Local $laddress = $mstringlogbase + 256 * $lagentid
- Local $lname = memoryread($laddress, "wchar [128]")
- If $lname = "" Then
- displayall(True)
- Sleep(100)
- displayall(False)
- EndIf
- Local $lname = memoryread($laddress, "wchar [128]")
- $lname = StringRegExpReplace($lname, "[<]{+)[>]{1})[>]{1}", "")
- Return $lname
- EndFunc
- #EndRegion AgentInfo
- #Region Buff
- Func getbuffcount($aheronumber = 0)
- Local $loffset[4]
- $loffset[0] = 0
- $loffset[1] = 24
- $loffset[2] = 44
- $loffset[3] = 1296
- Local $lcount = memoryreadptr($mbasepointer, $loffset)
- ReDim $loffset[5]
- $loffset[3] = 1288
- Local $lbuffer
- For $i = 0 To $lcount[1] - 1
- $loffset[4] = 36 * $i
- $lbuffer = memoryreadptr($mbasepointer, $loffset)
- If $lbuffer[1] == getheroid($aheronumber) Then
- Return memoryread($lbuffer[0] + 12)
- EndIf
- Next
- Return 0
- EndFunc
- Func getistargetbuffed($askillid, $aagentid, $aheronumber = 0)
- Local $lbuffstruct = DllStructCreate("long SkillId;byte unknown1[4];loITargetITargetITargetId")
- Local $lbuffcount = getbuffcount($aheronumber)
- Local $lbutaddressaddress
- Local $loffset[4]
- $loffset[0] = 0
- $loffset[1] = 24
- $loffset[2] = 44
- $loffset[3] = 1296
- Local $lcount = memoryreadptr($mbasepointer, $loffset)
- ReDim $loffset[5]
- $loffset[3] = 1288
- Local $lbuffer
- For $i = 0 To $lcount[1] - 1
- $loffset[4] = 36 * $i
- $lbuffer = memoryreadptr($mbasepointer, $loffset)
- If $lbuffer[1] == getheroid($aheronumber) Then
- $loffset[4] = 4 + 36 * $i
- ReDim $loffset[6]
- For $j = 0 To $lbuffcount - 1
- $loffset[5] = 0 + 16 * $j
- $lbutaddressaddress = memoryreadptr($mbasepointer, $loffset)
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $lbutaddressaddress[0], "ptr", DllStructGetPtr($lbuffstruct), "int", DllStructGetSize($lbuffstruct), "int", "")
- If (DllStructGetData($lbuffstruct, "SkillID") == $askillid) AND (DllStructGetData($lbuffstruct, "TargetId") == convertid($aagentid)) Then
- Return $j + 1
- EndIf
- Next
- EndIf
- Next
- Return 0
- EndFunc
- Func getbuffbyindex($abuffnumber, $aheronumber = 0)
- Local $lbuffstruct = DllStructCreate("long SkillId;byte unknown1[4];loITargetITargetITargetId")
- Local $loffset[4]
- $loffset[0] = 0
- $loffset[1] = 24
- $loffset[2] = 44
- $loffset[3] = 1296
- Local $lcount = memoryreadptr($mbasepointer, $loffset)
- ReDim $loffset[5]
- $loffset[3] = 1288
- Local $lbuffer
- For $i = 0 To $lcount[1] - 1
- $loffset[4] = 36 * $i
- $lbuffer = memoryreadptr($mbasepointer, $loffset)
- If $lbuffer[1] == getheroid($aheronumber) Then
- $loffset[4] = 4 + 36 * $i
- ReDim $loffset[6]
- $loffset[5] = 0 + 16 * ($abuffnumber - 1)
- $lbutaddressaddress = memoryreadptr($mbasepointer, $loffset)
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $lbutaddressaddress[0], "ptr", DllStructGetPtr($lbuffstruct), "int", DllStructGetSize($lbuffstruct), "int", "")
- Return $lbuffstruct
- EndIf
- Next
- Return 0
- EndFunc
- #EndRegion Buff
- #Region Misc
- Func getskillbar($aheronumber = 0)
- Local $lskillbarstruct = DllStructCreate("long ;long AdrenalineA1;lineA1;long AdrenalineB1;dword Recharge1;dword Id1;dword Event1;long AdrenalineA2;long AdrenalineB2;dword Recharge2;dword Id2;dword Event2;long AdrenalineA3;long AdrenalineB3;dword Recharge3;dword Id3;dword Event3;long AdrenalineA4;long AdrenalineB4;dword Recharge4;dword Id4;dword Event4;long AdrenalineA5;long AdrenalineB5;dword Recharge5;dword Id5;dword Event5;long AdrenalineA6;long AdrenalineB6;dword Recharge6;dword Id6;dword Event6;long AdrenalineA7;long AdrenalineB7;dword Recharge7;dword Id7;dword Event7;long AdrenalineA8;long AdrenalineB8;dword Recharge8;dword Id8;dword Event8;dworded;byte u8 Casti8 Castin Castin Casting")
- Local $loffset[5]
- $loffset[0] = 0
- $loffset[1] = 24
- $loffset[2] = 44
- $loffset[3] = 1776
- For $i = 0 To getherocount()
- $loffset[4] = $i * 188
- Local $lskillbtaddressaddress = memoryreadptr($mbasepointer, $loffset)
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $lskillbtaddressaddress[0], "ptr", DllStructGetPtr($lskillbarstruct), "int", DllStructGetSize($lskillbarstruct), "int", "")
- If DllStructGetData($lskillbarstruct, "AgentId") == getheroid($aheronumber) Then Return $lskillbarstruct
- Next
- EndFunc
- Func getskillbarskillid($askillslot, $aheronumber = 0)
- Return DllStructGetData(getskillbar($aheronumber), "ID" & $askillslot)
- EndFunc
- Func getskillbarskilladrenaline($askillslot, $aheronumber = 0)
- Return DllStructGetData(getskillbar($aheronumber), "AdrenalineA" & $askillslot)
- EndFunc
- Func getskillbarskillrecharge($askillslot, $aheronumber = 0)
- Local $ltimestamp = DllStructGetData(getskillbar($aheronumber), "Recharge" & $askillslot)
- If $ltimestamp == 0 Then Return 0
- Return $ltimestamp - getskilltimer()
- EndFunc
- Func getskillbyid($askillid)
- Local $lskillstruct = DllStructCreate("long Unknown1[4];long calong campaign;long Type;long Special;long ComboReq;long Effect1;long Condition;long Effect2;long WeaponReq;byte Profession;byte Attribute;byte Unknown2[2];long PvPID;byte Combo;byte Target;byte unknown3;byte EquipType;byte Unknown4[4];dword Adrenaline;float Activation;float Aftercast;long Duration0;long Duration15;long Recharge;byte Unknown5[12];long Scale0;long Scale15;long BonusScale0;long BonusScale15;float AoERaat ConstE ConstEyown6[4yown6[44own6[44]")
- Local $lskitaddressaddress = $mskillbase + 160 * $askillid
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $lskitaddressaddress, "ptr", DllStructGetPtr($lskillstruct), "int", DllStructGetSize($lskillstruct), "int", "")
- Return $lskillstruct
- EndFunc
- Func getmorale($aheronumber = 0)
- Local $lagentid = getheroid($aheronumber)
- Local $loffset[4]
- $loffset[0] = 0
- $loffset[1] = 24
- $loffset[2] = 44
- $loffset[3] = 1592
- Local $lindex = memoryreadptr($mbasepointer, $loffset)
- ReDim $loffset[6]
- $loffset[0] = 0
- $loffset[1] = 24
- $loffset[2] = 44
- $loffset[3] = 1580
- $loffset[4] = 8 + 12 * BitAND($lagentid, $lindex[1])
- $loffset[5] = 24
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1] - 100
- EndFunc
- Func geteffect($askillid = 0, $aheronumber = 0)
- Local $leffectcount, $leffetaddressaddress
- Local $lreturnarray[1] = [0]
- Local $loffset[4]
- $loffset[0] = 0
- $loffset[1] = 24
- $loffset[2] = 44
- $loffset[3] = 1296
- Local $lcount = memoryreadptr($mbasepointer, $loffset)
- ReDim $loffset[5]
- $loffset[3] = 1288
- Local $lbuffer
- For $i = 0 To $lcount[1] - 1
- $loffset[4] = 36 * $i
- $lbuffer = memoryreadptr($mbasepointer, $loffset)
- If $lbuffer[1] == getheroid($aheronumber) Then
- $loffset[4] = 28 + 36 * $i
- $leffectcount = memoryreadptr($mbasepointer, $loffset)
- ReDim $loffset[6]
- $loffset[4] = 20 + 36 * $i
- $loffset[5] = 0
- $leffetaddressaddress = memoryreadptr($mbasepointer, $loffset)
- If $askillid = 0 Then
- ReDim $lreturnarray[$leffectcount[1] + 1]
- $lreturnarray[0] = $leffectcount[1]
- For $i = 0 To $leffectcount[1] - 1
- $lreturnarray[$i + 1] = DllStructCreate("long ;long EffectType;lonype;long EffectId;lonId;float nimeStanimeStanimeStamimeStamp")
- $leffetaddressaddress[1] = $leffetaddressaddress[0] + 24 * $i
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $leffetaddressaddress[1], "ptr", DllStructGetPtr($lreturnarray[$i + 1]), "int", 24, "int", "")
- Next
- ExitLoop
- Else
- Local $lreturn = DllStructCreate("long ;long EffectType;lonype;long EffectId;lonId;float nimeStanimeStanimeStamimeStamp")
- For $i = 0 To $leffectcount[1] - 1
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $leffetaddressaddress[0] + 24 * $i, "ptr", DllStructGetPtr($lreturn), "int", 24, "int", "")
- If DllStructGetData($lreturn, "SkillID") = $askillid Then Return $lreturn
- Next
- EndIf
- EndIf
- Next
- Return $lreturnarray
- EndFunc
- Func geteffecttimeremaining($aeffect)
- If NOT IsDllStruct($aeffect) Then $aeffect = geteffect($aeffect)
- If IsArray($aeffect) Then Return 0
- Return DllStructGetData($aeffect, "Duration") * 1000 - (getskilltimer() - DllStructGetData($aeffect, "TimeStamp"))
- EndFunc
- Func getskilltimer()
- Return memoryread($mskilltimer, "long")
- EndFunc
- Func getattributebyid($aattributeid, $awithrunes = False, $aheronumber = 0)
- Local $lagentid = getheroid($aheronumber)
- Local $lbuffer
- Local $loffset[5]
- $loffset[0] = 0
- $loffset[1] = 24
- $loffset[2] = 44
- $loffset[3] = 172
- For $i = 0 To getherocount()
- $loffset[4] = 984 * $i
- $lbuffer = memoryreadptr($mbasepointer, $loffset)
- If $lbuffer[1] == $lagentid Then
- If $awithrunes Then
- $loffset[4] = 984 * $i + 20 * $aattributeid + 12
- Else
- $loffset[4] = 984 * $i + 20 * $aattributeid + 8
- EndIf
- $lbuffer = memoryreadptr($mbasepointer, $loffset)
- Return $lbuffer[1]
- EndIf
- Next
- EndFunc
- Func getexperience()
- Local $loffset[4] = [0, 24, 44, 1856]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getareavanquished()
- If getfoestokill() = 0 Then
- Return True
- Else
- Return False
- EndIf
- EndFunc
- Func getfoeskilled()
- Local $loffset[4] = [0, 24, 44, 2124]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getfoestokill()
- Local $loffset[4] = [0, 24, 44, 2128]
- Local $lreturn = memoryreadptr($mbasepointer, $loffset)
- Return $lreturn[1]
- EndFunc
- Func getmaxagents()
- Return memoryread($mmaxagents)
- EndFunc
- Func getmyid()
- Return memoryread($mmyid)
- EndFunc
- Func getcurrenttarget()
- Return getagentbyid(getcurrenttargetid())
- EndFunc
- Func getcurrenttargetid()
- Return memoryread($mcurrenttarget)
- EndFunc
- Func getping()
- Return memoryread($mping)
- EndFunc
- Func getmapid()
- Return memoryread($mmapid)
- EndFunc
- Func getmaploading()
- Return memoryread($mmaploading)
- EndFunc
- Func getmapisloaded()
- Return memoryread($mmapisloaded) AND getagentexists(-2)
- EndFunc
- Func getdistrict()
- Local $loffset[4] = [0, 24, 68, 436]
- Local $lresult = memoryreadptr($mbasepointer, $loffset)
- Return $lresult[1]
- EndFunc
- Func getregion()
- Return memoryread($mregion)
- EndFunc
- Func getlanguage()
- Return memoryread($mlanguage)
- EndFunc
- Func waitmaploading($amapid = 0, $adeadlock = 45000)
- Local $lmaploading
- Local $ldeadlock = TimerInit()
- initmapload()
- Do
- Sleep(200)
- $lmaploading = getmaploading()
- If $lmaploading == 2 Then $ldeadlock = TimerInit()
- If TimerDiff($ldeadlock) > $adeadlock AND $adeadlock > 0 Then Return False
- Until $lmaploading <> 2 AND getmapisloaded() AND (getmapid() = $amapid OR $amapid = 0)
- rndsleep(5000)
- Return True
- EndFunc
- Func getquestbyid($aquestid = 0)
- Local $lqueststruct = DllStructCreate("long LogState;byte unknoe unknown1[12];long MapFrom;floaat Y;bytenngbytenng Mapnng MapTng MapTo")
- Local $lquestptr, $lquestlogsize, $lquestid
- Local $loffset[4] = [0, 24, 44, 1332]
- $lquestlogsize = memoryreadptr($mbasepointer, $loffset)
- If $aquestid = 0 Then
- $loffset[1] = 24
- $loffset[2] = 44
- $loffset[3] = 1320
- $lquestid = memoryreadptr($mbasepointer, $loffset)
- $lquestid = $lquestid[1]
- Else
- $lquestid = $aquestid
- EndIf
- Local $loffset[5] = [0, 24, 44, 1324, 0]
- For $i = 0 To $lquestlogsize[1]
- $loffset[4] = 52 * $i
- $lquestptr = memoryreadptr($mbasepointer, $loffset)
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $lquestptr[0], "ptr", DllStructGetPtr($lqueststruct), "int", DllStructGetSize($lqueststruct), "int", "")
- If DllStructGetData($lqueststruct, "ID") = $lquestid Then Return $lqueststruct
- Next
- EndFunc
- Func getcharname()
- Return memoryread($mcharname, "wchar[30]")
- EndFunc
- Func getloggedin()
- Return memoryread($mloggedin)
- EndFunc
- Func getdisplaylanguage()
- Local $loffset[6] = [0, 24, 24, 404, 76, 64]
- Local $lresult = memoryreadptr($mbasepointer, $loffset)
- Return $lresult[1]
- EndFunc
- Func getinstanceuptime()
- Local $loffset[4]
- $loffset[0] = 0
- $loffset[1] = 24
- $loffset[2] = 8
- $loffset[3] = 428
- Local $ltimer = memoryreadptr($mbasepointer, $loffset)
- Return $ltimer[1]
- EndFunc
- Func getbuildnumber()
- Return $mbuildnumber
- EndFunc
- Func getprofprimaryattribute($aprofession)
- Switch $aprofession
- Case 1
- Return 17
- Case 2
- Return 23
- Case 3
- Return 16
- Case 4
- Return 6
- Case 5
- Return 0
- Case 6
- Return 12
- Case 7
- Return 35
- Case 8
- Return 36
- Case 9
- Return 40
- Case 10
- Return 44
- EndSwitch
- EndFunc
- #EndRegion Misc
- #EndRegion Queries
- #Region Other Functions
- #Region Misc
- Func rndsleep($aamount, $arandom = 0.05)
- Local $lrandom = $aamount * $arandom
- Sleep(Random($aamount - $lrandom, $aamount + $lrandom))
- EndFunc
- Func tolsleep($aamount = 150, $atolerance = 50)
- Sleep(Random($aamount - $atolerance, $aamount + $atolerance))
- EndFunc
- Func getwindowhandle()
- Return $mgwhwnd
- EndFunc
- Func computedistance($ax1, $ay1, $ax2, $ay2)
- Return Sqrt(($ax1 - $ax2) ^ 2 + ($ay1 - $ay2) ^ 2)
- EndFunc
- Func getdistance($aagent1 = -1, $aagent2 = -2)
- If IsDllStruct($aagent1) = 0 Then $aagent1 = getagentbyid($aagent1)
- If IsDllStruct($aagent2) = 0 Then $aagent2 = getagentbyid($aagent2)
- Return Sqrt((DllStructGetData($aagent1, "X") - DllStructGetData($aagent2, "X")) ^ 2 + (DllStructGetData($aagent1, "Y") - DllStructGetData($aagent2, "Y")) ^ 2)
- EndFunc
- Func getpseudodistance($aagent1, $aagent2)
- Return (DllStructGetData($aagent1, "X") - DllStructGetData($aagent2, "X")) ^ 2 + (DllStructGetData($aagent1, "Y") - DllStructGetData($aagent2, "Y")) ^ 2
- EndFunc
- Func getispointinpolygon($aareacoords, $aposx = 0, $aposy = 0)
- Local $lposition
- Local $ledges = UBound($aareacoords)
- Local $loddnodes = False
- If $ledges < 3 Then Return False
- If $aposx = 0 Then
- Local $lagent = getagentbyid(-2)
- $aposx = DllStructGetData($lagent, "X")
- $aposy = DllStructGetData($lagent, "Y")
- EndIf
- $j = $ledges - 1
- For $i = 0 To $ledges - 1
- If (($aareacoords[$i][1] < $aposy AND $aareacoords[$j][1] >= $aposy) OR ($aareacoords[$j][1] < $aposy AND $aareacoords[$i][1] >= $aposy)) AND ($aareacoords[$i][0] <= $aposx OR $aareacoords[$j][0] <= $aposx) Then
- If ($aareacoords[$i][0] + ($aposy - $aareacoords[$i][1]) / ($aareacoords[$j][1] - $aareacoords[$i][1]) * ($aareacoords[$j][0] - $aareacoords[$i][0]) < $aposx) Then
- $loddnodes = NOT $loddnodes
- EndIf
- EndIf
- $j = $i
- Next
- Return $loddnodes
- EndFunc
- Func convertid($aid)
- If $aid = -2 Then
- Return getmyid()
- ElseIf $aid = -1 Then
- Return getcurrenttargetid()
- Else
- Return $aid
- EndIf
- EndFunc
- Func sendpacket($asize, $aheader, $aparam1 = 0, $aparam2 = 0, $aparam3 = 0, $aparam4 = 0, $aparam5 = 0, $aparam6 = 0, $aparam7 = 0, $aparam8 = 0, $aparam9 = 0, $aparam10 = 0)
- If getagentexists(-2) Then
- DllStructSetData($mpacket, 2, $asize)
- DllStructSetData($mpacket, 3, $aheader + 1)
- DllStructSetData($mpacket, 4, $aparam1)
- DllStructSetData($mpacket, 5, $aparam2)
- DllStructSetData($mpacket, 6, $aparam3)
- DllStructSetData($mpacket, 7, $aparam4)
- DllStructSetData($mpacket, 8, $aparam5)
- DllStructSetData($mpacket, 9, $aparam6)
- DllStructSetData($mpacket, 10, $aparam7)
- DllStructSetData($mpacket, 11, $aparam8)
- DllStructSetData($mpacket, 12, $aparam9)
- DllStructSetData($mpacket, 13, $aparam10)
- enqueue($mpacketptr, 52)
- Return True
- Else
- Return False
- EndIf
- EndFunc
- Func performaction($aaction, $aflag)
- If getagentexists(-2) Then
- DllStructSetData($maction, 2, $aaction)
- DllStructSetData($maction, 3, $aflag)
- enqueue($mactionptr, 12)
- Return True
- Else
- Return False
- EndIf
- EndFunc
- Func bin64todec($abinary)
- Local $lreturn = 0
- For $i = 1 To StringLen($abinary)
- If StringMid($abinary, $i, 1) == 1 Then $lreturn += 2 ^ ($i - 1)
- Next
- Return $lreturn
- EndFunc
- Func base64tobin64($acharacter)
- Select
- Case $acharacter == "A"
- Return "000000"
- Case $acharacter == "B"
- Return "100000"
- Case $acharacter == "C"
- Return "010000"
- Case $acharacter == "D"
- Return "110000"
- Case $acharacter == "E"
- Return "001000"
- Case $acharacter == "F"
- Return "101000"
- Case $acharacter == "G"
- Return "011000"
- Case $acharacter == "H"
- Return "111000"
- Case $acharacter == "I"
- Return "000100"
- Case $acharacter == "J"
- Return "100100"
- Case $acharacter == "K"
- Return "010100"
- Case $acharacter == "L"
- Return "110100"
- Case $acharacter == "M"
- Return "001100"
- Case $acharacter == "N"
- Return "101100"
- Case $acharacter == "O"
- Return "011100"
- Case $acharacter == "P"
- Return "111100"
- Case $acharacter == "Q"
- Return "000010"
- Case $acharacter == "R"
- Return "100010"
- Case $acharacter == "S"
- Return "010010"
- Case $acharacter == "T"
- Return "110010"
- Case $acharacter == "U"
- Return "001010"
- Case $acharacter == "V"
- Return "101010"
- Case $acharacter == "W"
- Return "011010"
- Case $acharacter == "X"
- Return "111010"
- Case $acharacter == "Y"
- Return "000110"
- Case $acharacter == "Z"
- Return "100110"
- Case $acharacter == "a"
- Return "010110"
- Case $acharacter == "b"
- Return "110110"
- Case $acharacter == "c"
- Return "001110"
- Case $acharacter == "d"
- Return "101110"
- Case $acharacter == "e"
- Return "011110"
- Case $acharacter == "f"
- Return "111110"
- Case $acharacter == "g"
- Return "000001"
- Case $acharacter == "h"
- Return "100001"
- Case $acharacter == "i"
- Return "010001"
- Case $acharacter == "j"
- Return "110001"
- Case $acharacter == "k"
- Return "001001"
- Case $acharacter == "l"
- Return "101001"
- Case $acharacter == "m"
- Return "011001"
- Case $acharacter == "n"
- Return "111001"
- Case $acharacter == "o"
- Return "000101"
- Case $acharacter == "p"
- Return "100101"
- Case $acharacter == "q"
- Return "010101"
- Case $acharacter == "r"
- Return "110101"
- Case $acharacter == "s"
- Return "001101"
- Case $acharacter == "t"
- Return "101101"
- Case $acharacter == "u"
- Return "011101"
- Case $acharacter == "v"
- Return "111101"
- Case $acharacter == "w"
- Return "000011"
- Case $acharacter == "x"
- Return "100011"
- Case $acharacter == "y"
- Return "010011"
- Case $acharacter == "z"
- Return "110011"
- Case $acharacter == "0"
- Return "001011"
- Case $acharacter == "1"
- Return "101011"
- Case $acharacter == "2"
- Return "011011"
- Case $acharacter == "3"
- Return "111011"
- Case $acharacter == "4"
- Return "000111"
- Case $acharacter == "5"
- Return "100111"
- Case $acharacter == "6"
- Return "010111"
- Case $acharacter == "7"
- Return "110111"
- Case $acharacter == "8"
- Return "001111"
- Case $acharacter == "9"
- Return "101111"
- Case $acharacter == "+"
- Return "011111"
- Case $acharacter == "/"
- Return "111111"
- EndSelect
- EndFunc
- #EndRegion Misc
- #Region Callback
- Func setevent($askillactivate = "", $askillcancel = "", $askillcomplete = "", $achatreceive = "", $aloadfinished = "")
- If NOT $museeventsystem Then Return
- If $askillactivate <> "" Then
- writedetour("SkillLogStart", "SkillLogProc")
- Else
- $masmstring = ""
- _("inc eax")
- _("mov dw+10],eax10],eax")
- _("pop esi")
- writebinary($masmstring, getvalue("SkillLogStart"))
- EndIf
- If $askillcancel <> "" Then
- writedetour("SkilLogStartogStart", "SkilLogProcLogProc")
- Else
- $masmstring = ""
- _("push 0")
- _("push 42")
- _("mov ecx,esi")
- writebinary($masmstring, getvalue("SkilLogStartogStart"))
- EndIf
- If $askillcomplete <> "" Then
- writedetour("SkillCLogStartogStart", "SkilleLogProcLogProc")
- Else
- $masmstring = ""
- _("mov ed[edi+4][edi+4]")
- _("test eax,eax")
- writebinary($masmstring, getvalue("SkillCLogStartogStart"))
- EndIf
- If $achatreceive <> "" Then
- writedetour("ChatLogStart", "ChatLogProc")
- Else
- $masmstring = ""
- _("add edi,E")
- _("cmp eax,B")
- writebinary($masmstring, getvalue("ChatLogStart"))
- EndIf
- $mskillactivate = $askillactivate
- $mskillcancel = $askillcancel
- $mskillcomplete = $askillcomplete
- $mchatreceive = $achatreceive
- $mloadfinished = $aloadfinished
- EndFunc
- Func event($hwnd, $msg, $wparam, $lparam)
- Switch $lparam
- Case 1
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $wparam, "ptr", $msktructptrructptr, "int", 16, "int", "")
- Call($mskillactivate, DllStructGetData($mskilllogstruct, 1), DllStructGetData($mskilllogstruct, 2), DllStructGetData($mskilllogstruct, 3), DllStructGetData($mskilllogstruct, 4))
- Case 2
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $wparam, "ptr", $msktructptrructptr, "int", 16, "int", "")
- Call($mskillcancel, DllStructGetData($mskilllogstruct, 1), DllStructGetData($mskilllogstruct, 2), DllStructGetData($mskilllogstruct, 3))
- Case 3
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $wparam, "ptr", $msktructptrructptr, "int", 16, "int", "")
- Call($mskillcomplete, DllStructGetData($mskilllogstruct, 1), DllStructGetData($mskilllogstruct, 2), DllStructGetData($mskilllogstruct, 3))
- Case 4
- DllCall($mkernelhandle, "int", "RessMemorysMemory", "int", $mgwprochandle, "int", $wparam, "ptr", $mctructptrructptr, "int", 512, "int", "")
- Local $lmessage = DllStructGetData($mchatlogstruct, 2)
- Local $lchannel
- Local $lsender
- Switch DllStructGetData($mchatlogstruct, 1)
- Case 0
- $lchannel = "Alliance"
- $lsender = StringMid($lmessage, 6, StringInStr($lmessage, "</a>") - 6)
- $lmessage = StringTrimLeft($lmessage, StringInStr($lmessage, "<quote>") + 6)
- Case 3
- $lchannel = "All"
- $lsender = StringMid($lmessage, 6, StringInStr($lmessage, "</a>") - 6)
- $lmessage = StringTrimLeft($lmessage, StringInStr($lmessage, "<quote>") + 6)
- Case 9
- $lchannel = "Guild"
- $lsender = StringMid($lmessage, 6, StringInStr($lmessage, "</a>") - 6)
- $lmessage = StringTrimLeft($lmessage, StringInStr($lmessage, "<quote>") + 6)
- Case 11
- $lchannel = "Team"
- $lsender = StringMid($lmessage, 6, StringInStr($lmessage, "</a>") - 6)
- $lmessage = StringTrimLeft($lmessage, StringInStr($lmessage, "<quote>") + 6)
- Case 12
- $lchannel = "Trade"
- $lsender = StringMid($lmessage, 6, StringInStr($lmessage, "</a>") - 6)
- $lmessage = StringTrimLeft($lmessage, StringInStr($lmessage, "<quote>") + 6)
- Case 10
- If StringLeft($lmessage, 3) == "-> " Then
- $lchannel = "Sent"
- $lsender = StringMid($lmessage, 10, StringInStr($lmessage, "</a>") - 10)
- $lmessage = StringTrimLeft($lmessage, StringInStr($lmessage, "<quote>") + 6)
- Else
- $lchannel = "Global"
- $lsender = "Guild Wars"
- EndIf
- Case 13
- $lchannel = "Advisory"
- $lsender = "Guild Wars"
- $lmessage = StringTrimLeft($lmessage, StringInStr($lmessage, "<quote>") + 6)
- Case 14
- $lchannel = "Whisper"
- $lsender = StringMid($lmessage, 7, StringInStr($lmessage, "</a>") - 7)
- $lmessage = StringTrimLeft($lmessage, StringInStr($lmessage, "<quote>") + 6)
- Case Else
- $lchannel = "Other"
- $lsender = "Other"
- EndSwitch
- Call($mchatreceive, $lchannel, $lsender, $lmessage)
- Case 5
- Call($mloadfinished)
- EndSwitch
- EndFunc
- #EndRegion Callback
- #Region Modification
- Func modifymemory()
- $masmsize = 0
- $masmcodeoffset = 0
- $masmstring = ""
- createdata()
- createmain()
- createtargetlog()
- createskilllog()
- createskillcancellog()
- createskillcompletelog()
- createchatlog()
- createtraderhook()
- createloadfinished()
- createstringlog()
- createstringfilter1()
- createstringfilter2()
- createrenderingmod()
- createcommands()
- Local $lmodmemory = memoryread(memoryread($mbase), "ptr")
- If $lmodmemory = 0 Then
- $mmemory = DllCall($mkernelhandle, "ptr", "VirtualAllocEx", "handle", $mgwprochandle, "ptr", 0, "ulong_ptr", $masmsize, "dword", 4096, "dword", 64)
- $mmemory = $mmemory[0]
- memorywrite(memoryread($mbase), $mmemory)
- Else
- $mmemory = $lmodmemory
- EndIf
- completeasmcode()
- If $lmodmemory = 0 Then
- writebinary($masmstring, $mmemory + $masmcodeoffset)
- writebinary("83F8009090", getvalue("ClickToMoveFix"))
- memorywrite(getvalue("QueuePtr"), getvalue("QueueBase"))
- memorywrite(getvalue("SkillLogPtr"), getvalue("SkillLogBase"))
- memorywrite(getvalue("ChatLogPtr"), getvalue("ChatLogBase"))
- memorywrite(getvalue("StringLogPtr"), getvalue("StringLogBase"))
- EndIf
- writedetour("MainStart", "MainProc")
- writedetour("TargetLogStart", "TargetLogProc")
- writedetour("TraderHookStart", "TraderHookProc")
- writedetour("LohedStartedStart", "LoadFinishedProc")
- writedetour("RenderingMod", "RenderingModProc")
- If $musestringlog Then
- writedetour("StringLogStart", "StringLogProc")
- writedetour("Strer1Startr1Start", "Stter1Procer1Proc")
- writedetour("Strer2Startr2Start", "Stter2Procer2Proc")
- EndIf
- EndFunc
- Func writedetour($afrom, $ato)
- writebinary("E9" & swapendian(Hex(getlabelinfo($ato) - getlabelinfo($afrom) - 5)), getlabelinfo($afrom))
- EndFunc
- Func createdata()
- _("CallbackHandle/4")
- _("QueueCounter/4")
- _("Skounter/4unter/4")
- _("ChatLogCounter/4")
- _("ChatLogLastMsg/4")
- _("MapIsLoaded/4")
- _("NextStringType/4")
- _("EnsureEnglish/4")
- _("TraderQuoteID/4")
- _("TraderCostID/4")
- _("TrtValue/4Value/4")
- _("Disdering/4ering/4")
- _("QueueBase/" & 256 * getvalue("QueueSize"))
- _("TargetLogBase/" & 4 * getvalue("TargetLogSize"))
- _("SkillLogBase/" & 16 * getvalue("SkillLogSize"))
- _("StringLogBase/" & 256 * getvalue("StringLogSize"))
- _("ChatLogBase/" & 512 * getvalue("ChatLogSize"))
- _("AgentCopyCount/4")
- _("AgentCopyBase/" & 448 * 256)
- EndFunc
- Func createmain()
- _("MainProc:")
- _("pushad")
- _("mov eax,dwordEnglishEnglish]")
- _("test eax,eax")
- _("jz MainMain")
- _("mov ecx,dwoPointerPointer]")
- _("mov ec[ecx+18]ecx+18]")
- _("mov ec[ecx+18]ecx+18]")
- _("mov ecxecx+194]cx+194]")
- _("mov [ecx+4f]ecx+4f]")
- _("cmp al,f")
- _("ja MainMain")
- _("mov ec[ecx+4c]ecx+4c]")
- _("mov [ecx+3f]ecx+3f]")
- _("cmp al,f")
- _("ja MainMain")
- _("mov ea[ecx+40]ecx+40]")
- _("test eax,eax")
- _("jz MainMain")
- _("mov ecx,dwionBaseionBase]")
- _("mov ecxecx+170]cx+170]")
- _("mov ec[ecx+20]ecx+20]")
- _("movord[ecx]rd[ecx]")
- _("push 0")
- _("push 0")
- _("push bb")
- _("mov edx,esp")
- _("push 0")
- _("push edx")
- _("push 18")
- _("callFunctionunction")
- _("pop eax")
- _("pop ebx")
- _("pop ecx")
- _("MainMain:")
- _("mov eax,dworCounterCounter]")
- _("mov ecx,eax")
- _("shl eax,8")
- _("adueueBaseeueBase")
- _("movord[eax]rd[eax]")
- _("test ebx,ebx")
- _("jz MainExit")
- _("push ecx")
- _("mov dword[eax],0")
- _("jmp ebx")
- _("CommandReturn:")
- _("pop eax")
- _("inc eax")
- _("cmueueSizeeueSize")
- _("jnkipResetipReset")
- _("xor eax,eax")
- _("MainSkipReset:")
- _("mov dword[Quter],eater],eax")
- _("MainExit:")
- _("popad")
- _("mov ebp,esp")
- _("sub esp,14")
- _("ljmp MainReturn")
- EndFunc
- Func createtargetlog()
- _("TargetLogProc:")
- _("cmp ecx,4")
- _("jz TargetLogMain")
- _("cmp ecx,32")
- _("jz TargetLogMain")
- _("cmp ecx,3C")
- _("jz TargetLogMain")
- _("jmtLogExitLogExit")
- _("TargetLogMain:")
- _("pushad")
- _("mov ed[ebp+8][ebp+8]")
- _("test ecx,ecx")
- _("jnzLogStoreogStore")
- _("mov ecx,edx")
- _("TargetLogStore:")
- _("leword[edwo4LogBaseLogBase]ogBase]")
- _("moveax],ecxax],ecx")
- _("popad")
- _("TargetLogExit:")
- _("push ebx")
- _("push esi")
- _("push edi")
- _("mov edi,edx")
- _("ljmp ogReturngReturn")
- EndFunc
- Func createskilllog()
- _("SkillLogProc:")
- _("pushad")
- _("mov eax,dword[SCounterCounter]")
- _("push eax")
- _("shl eax,4")
- _("add elLogBaseLogBase")
- _("movord[edi]rd[edi]")
- _("moveax],ecxax],ecx")
- _("moword[ecwo4LogBaseLogBase]ogBase]")
- _("mov dx+4],ecx+4],ecx")
- _("mov ed[edi+4][edi+4]")
- _("mov dx+8],ecx+8],ecx")
- _("mov ed[edi+8][edi+8]")
- _("mov dx+c],ecx+c],ecx")
- _("push 1")
- _("push eax")
- _("pusackEventckEvent")
- _("push dword[kHandlekHandle]")
- _("call dwoMessage]essage]")
- _("pop eax")
- _("inc eax")
- _("cmp elLogSizeLogSize")
- _("jnz SkkipResetipReset")
- _("xor eax,eax")
- _("SkiipReset:pReset:")
- _("mov dword[Skillter],eater],eax")
- _("popad")
- _("inc eax")
- _("mov dw+10],eax10],eax")
- _("pop esi")
- _("ljmpogReturngReturn")
- EndFunc
- Func createskillcancellog()
- _("SkilLogProc:ogProc:")
- _("pushad")
- _("mov eax,dword[SCounterCounter]")
- _("push eax")
- _("shl eax,4")
- _("add elLogBaseLogBase")
- _("movord[edi]rd[edi]")
- _("moveax],ecxax],ecx")
- _("moword[ecwo4LogBaseLogBase]ogBase]")
- _("mov dx+4],ecx+4],ecx")
- _("mov ed[edi+4][edi+4]")
- _("mov dx+8],ecx+8],ecx")
- _("push 2")
- _("push eax")
- _("pusackEventckEvent")
- _("push dword[kHandlekHandle]")
- _("call dwoMessage]essage]")
- _("pop eax")
- _("inc eax")
- _("cmp elLogSizeLogSize")
- _("jnz SkillCankipResekipReset")
- _("xor eax,eax")
- _("SkillCancipResetipReset:")
- _("mov dword[Skillter],eater],eax")
- _("popad")
- _("push 0")
- _("push 42")
- _("mov ecx,esi")
- _("ljmp SkillogReturogReturn")
- EndFunc
- Func createskillcompletelog()
- _("SkillCLogProc:ogProc:")
- _("pushad")
- _("mov eax,dword[SCounterCounter]")
- _("push eax")
- _("shl eax,4")
- _("add elLogBaseLogBase")
- _("movord[edi]rd[edi]")
- _("moveax],ecxax],ecx")
- _("moword[ecwo4LogBaseLogBase]ogBase]")
- _("mov dx+4],ecx+4],ecx")
- _("mov ed[edi+4][edi+4]")
- _("mov dx+8],ecx+8],ecx")
- _("push 3")
- _("push eax")
- _("pusackEventckEvent")
- _("push dword[kHandlekHandle]")
- _("call dwoMessage]essage]")
- _("pop eax")
- _("inc eax")
- _("cmp elLogSizeLogSize")
- _("jnz SkillComplkipResekipReset")
- _("xor eax,eax")
- _("SkillCompleipResetipReset:")
- _("mov dword[Skillter],eater],eax")
- _("popad")
- _("mov ed[edi+4][edi+4]")
- _("test eax,eax")
- _("ljmp SkillCoogReturogReturn")
- EndFunc
- Func createchatlog()
- _("ChatLogProc:")
- _("pushad")
- _("mov ecxesp+1F4]sp+1F4]")
- _("mov ebx,eax")
- _("mov eax,dword[CounterCounter]")
- _("push eax")
- _("shl eax,9")
- _("add tLogBaseLogBase")
- _("moveax],ebxax],ebx")
- _("mov edi,eax")
- _("add eax,4")
- _("xor ebx,ebx")
- _("ChatLogCopyLoop:")
- _("mov dx,word[ecx]")
- _("mov word[eax],dx")
- _("add ecx,2")
- _("add eax,2")
- _("inc ebx")
- _("cmp ebx,FF")
- _("jz CopyExitopyExit")
- _("test dx,dx")
- _("jnz CopyLoopopyLoop")
- _("ChatLogCopyExit:")
- _("push 4")
- _("push edi")
- _("pusackEventckEvent")
- _("push dword[kHandlekHandle]")
- _("call dwoMessage]essage]")
- _("pop eax")
- _("inc eax")
- _("cmp tLogSizeLogSize")
- _("jnz CkipResetipReset")
- _("xor eax,eax")
- _("ChipReset:pReset:")
- _("mov dword[Chatter],eater],eax")
- _("popad")
- _("ChatLogExit:")
- _("add edi,E")
- _("cmp eax,B")
- _("ljmogReturngReturn")
- EndFunc
- Func createtraderhook()
- _("TraderHookProc:")
- _("mov dword[TrtID],ectID],ecx")
- _("mov dword[Tradelue],edlue],edx")
- _("push eax")
- _("mov eax,dwordQuoteIDQuoteID]")
- _("inc eax")
- _("cmp eax,200")
- _("jnz kipResetipReset")
- _("xor eax,eax")
- _("TraderSkipReset:")
- _("mov dword[TraeID],eaeID],eax")
- _("pop eax")
- _("mov ebp,esp")
- _("sub esp,8")
- _("ljmp TokReturnkReturn")
- EndFunc
- Func createloadfinished()
- _("LohedProc:edProc:")
- _("pushad")
- _("mov eax,1")
- _("mov dword[Mded],eaded],eax")
- _("xor ebx,ebx")
- _("mov eagLogBaseLogBase")
- _("LoadClngsLoop:gsLoop:")
- _("mov dword[eax],0")
- _("inc ebx")
- _("add eax,100")
- _("cmp ebgLogSizeLogSize")
- _("jnz LoadCingsLooingsLoop")
- _("xor ebx,ebx")
- _("mov eatLogBaseLogBase")
- _("LoadCletsLoop:tsLoop:")
- _("mov dword[eax],0")
- _("inc ebx")
- _("add eax,4")
- _("cmp ebtLogSizeLogSize")
- _("jnz LoadCgetsLoogetsLoop")
- _("push 5")
- _("push 0")
- _("pusackEventckEvent")
- _("push dword[kHandlekHandle]")
- _("call dwoMessage]essage]")
- _("popad")
- _("mov ed[esi+1C]esi+1C]")
- _("mov ecx,edi")
- _("ljmp LoaedReturndReturn")
- EndFunc
- Func createstringlog()
- _("StringLogProc:")
- _("pushad")
- _("mov eax,dword[ingTypeingType]")
- _("test eax,eax")
- _("jz StringLogExit")
- _("cmp eax,1")
- _("jnz SgFilter2Filter2")
- _("mov eaxebp+37c]bp+37c]")
- _("jmp StringeCheckgeCheck")
- _("StFilter2:ilter2:")
- _("cmp eax,2")
- _("jngLogExitLogExit")
- _("mov eaxebp+338]bp+338]")
- _("StringeCheck:eCheck:")
- _("mov dword[NegType],gType],0")
- _("cmp eax,0")
- _("jbgLogExitLogExit")
- _("cmp eagLogSizeLogSize")
- _("jagLogExitLogExit")
- _("shl eax,8")
- _("add eagLogBaseLogBase")
- _("xor ebx,ebx")
- _("StropyLoop:pyLoop:")
- _("mov dx,word[ecx]")
- _("mov word[eax],dx")
- _("add ecx,2")
- _("add eax,2")
- _("inc ebx")
- _("cmp ebx,80")
- _("jz StringLogExit")
- _("test dx,dx")
- _("jnz StCopyLoopopyLoop")
- _("StringLogExit:")
- _("popad")
- _("mov esp,ebp")
- _("pop ebp")
- _("retn 10")
- EndFunc
- Func createstringfilter1()
- _("Strer1Proc:r1Proc:")
- _("mov dword[NegType],gType],1")
- _("push ebp")
- _("mov ebp,esp")
- _("push ecx")
- _("push esi")
- _("ljmp Strir1Returr1Return")
- EndFunc
- Func createstringfilter2()
- _("Strer2Proc:r2Proc:")
- _("mov dword[NegType],gType],2")
- _("push ebp")
- _("mov ebp,esp")
- _("push ecx")
- _("push esi")
- _("ljmp Strir2Returr2Return")
- EndFunc
- Func createrenderingmod()
- _("ReModProc:odProc:")
- _("cmp dword[Disaering],ering],1")
- _("jz RenderinpComparpCompare")
- _("cmp eax,ebx")
- _("ljne RenodReturndReturn")
- _("RenderingCompareCompare:")
- $masmsize += 17
- $masmstring &= StringTrimLeft(memoryread(getvalue("RenderingMod") + 4, "byte[17]"), 2)
- _("cmp dword[Disaering],ering],1")
- _("jz DisabringProcingProc")
- _("retn")
- _("DisablingProc:ngProc:")
- _("push 1")
- _("cad[Sleep][Sleep]")
- _("retn")
- EndFunc
- Func createcommands()
- _("CommandUseSkill:")
- _("mov rd[MyID]d[MyID]")
- _("mov ed[eax+C][eax+C]")
- _("push edx")
- _("mov ed[eax+4][eax+4]")
- _("dec edx")
- _("pud[eax+8][eax+8]")
- _("call UFunctionunction")
- _("ljmndReturndReturn")
- _("CommandMove:")
- _("lea ed[eax+4][eax+4]")
- _("caFunctionunction")
- _("ljmndReturndReturn")
- _("CommaeTarget:Target:")
- _("mov ed[eax+4][eax+4]")
- _("xor edx,edx")
- _("call ChangFunctioFunction")
- _("ljmndReturndReturn")
- _("ComketSend:etSend:")
- _("mov ecx,dword[ocationocation]")
- _("lea ed[eax+8][eax+8]")
- _("push edx")
- _("mov ed[eax+4][eax+4]")
- _("mov eax,ecx")
- _("call PacFunctionunction")
- _("ljmndReturndReturn")
- _("CoiteChat:teChat:")
- _("add eax,4")
- _("mov edx,eax")
- _("xor ecx,ecx")
- _("add eax,28")
- _("push eax")
- _("call WrFunctionunction")
- _("ljmndReturndReturn")
- _("CommandSellItem:")
- _("push 0")
- _("push 0")
- _("push 0")
- _("pud[eax+4][eax+4]")
- _("push 0")
- _("add eax,8")
- _("push eax")
- _("push 1")
- _("mov ecx,b")
- _("xor edx,edx")
- _("call SFunctionunction")
- _("ljmndReturndReturn")
- _("CommandBuyItem:")
- _("add eax,4")
- _("push eax")
- _("add eax,4")
- _("push eax")
- _("push 1")
- _("push 0")
- _("push 0")
- _("push 0")
- _("push 0")
- _("mov ecx,1")
- _("mov ed[eax+4][eax+4]")
- _("call Functionunction")
- _("ljmndReturndReturn")
- _("CommandAction:")
- _("mov ecx,dwionBaseionBase]")
- _("mov ecxecx+250]cx+250]")
- _("mov ec[ecx+10]ecx+10]")
- _("movord[ecx]rd[ecx]")
- _("push 0")
- _("push 0")
- _("pud[eax+4][eax+4]")
- _("mov edx,esp")
- _("push 0")
- _("push edx")
- _("pud[eax+8][eax+8]")
- _("callFunctionunction")
- _("pop eax")
- _("pop ebx")
- _("pop ecx")
- _("ljmndReturndReturn")
- _("Commandanguage:nguage:")
- _("mov ecx,dwionBaseionBase]")
- _("mov ecxecx+170]cx+170]")
- _("mov ec[ecx+20]ecx+20]")
- _("movord[ecx]rd[ecx]")
- _("push 0")
- _("push 0")
- _("push bb")
- _("mov edx,esp")
- _("push 0")
- _("push edx")
- _("pud[eax+4][eax+4]")
- _("callFunctionunction")
- _("pop eax")
- _("pop ebx")
- _("pop ecx")
- _("ljmndReturndReturn")
- _("CommaroSkill:oSkill:")
- _("mov ed[eax+4][eax+4]")
- _("mov ed[eax+c][eax+c]")
- _("mov ed[eax+8][eax+8]")
- _("push eax")
- _("call UseHeFunctioFunction")
- _("ljmndReturndReturn")
- _("CommandSendChat:")
- _("mov ecx,dword[ocationocation]")
- _("add eax,4")
- _("push eax")
- _("mov edx,11c")
- _("mov eax,ecx")
- _("call PacFunctionunction")
- _("ljmndReturndReturn")
- _("CommastQuote:tQuote:")
- _("mov dword[ostID],ostID],0")
- _("mov dword[TraValue],Value],0")
- _("add eax,4")
- _("push eax")
- _("push 1")
- _("push 0")
- _("push 0")
- _("push 0")
- _("push 0")
- _("mov ecx,c")
- _("xor edx,edx")
- _("call RequeFunctioFunction")
- _("ljmndReturndReturn")
- _("CommandReoteSelloteSell:")
- _("mov dword[ostID],ostID],0")
- _("mov dword[TraValue],Value],0")
- _("push 0")
- _("push 0")
- _("push 0")
- _("add eax,4")
- _("push eax")
- _("push 1")
- _("push 0")
- _("mov ecx,d")
- _("xor edx,edx")
- _("call RequeFunctioFunction")
- _("ljmndReturndReturn")
- _("CoaderBuy:derBuy:")
- _("push 0")
- _("puerCostIDrCostID")
- _("push 1")
- _("push 0")
- _("push 0")
- _("push 0")
- _("push 0")
- _("mov ecx,c")
- _("mov edx,dword[TstValuestValue]")
- _("callFunctionunction")
- _("mov dword[ostID],ostID],0")
- _("mov dword[TraValue],Value],0")
- _("ljmndReturndReturn")
- _("ComderSell:erSell:")
- _("push 0")
- _("push 0")
- _("push 0")
- _("push dword[TstValuestValue]")
- _("push 0")
- _("puerCostIDrCostID")
- _("push 1")
- _("mov ecx,d")
- _("xor edx,edx")
- _("callFunctionunction")
- _("mov dword[ostID],ostID],0")
- _("mov dword[TraValue],Value],0")
- _("ljmndReturndReturn")
- _("CommandSalvage:")
- _("mov ebgeGlobaleGlobal")
- _("mov ed[eax+4][eax+4]")
- _("movebx],ecxbx],ecx")
- _("push ecx")
- _("mov ed[eax+8][eax+8]")
- _("add ebx,4")
- _("movebx],ecxbx],ecx")
- _("mov ed[eax+c][eax+c]")
- _("movebx],ecxbx],ecx")
- _("call Functionunction")
- _("ljmndReturndReturn")
- _("CommandInctributetribute:")
- _("mov ed[eax+4][eax+4]")
- _("mov ed[eax+8][eax+8]")
- _("call IncreaseAtFunctioFunction")
- _("ljmndReturndReturn")
- _("CommandDectributetribute:")
- _("mov ed[eax+4][eax+4]")
- _("mov ed[eax+8][eax+8]")
- _("call DecreaseAtFunctioFunction")
- _("ljmndReturndReturn")
- _("CommandntArray:tArray:")
- _("mov ed[eax+4][eax+4]")
- _("xor ebx,ebx")
- _("xor edx,edx")
- _("mov edCopyBaseopyBase")
- _("AgenopStart:pStart:")
- _("inc ebx")
- _("cmp ebx,dxAgentsxAgents]")
- _("jge AgLoopExitoopExit")
- _("mov esi,dentBaseentBase]")
- _("lea esi,di+ebx*4i+ebx*4]")
- _("movord[esi]rd[esi]")
- _("test esi,esi")
- _("jz AgeoopStartopStart")
- _("cmp eax,0")
- _("jz CopyAgent")
- _("cmp ea[esi+9C]esi+9C]")
- _("jnz AgeoopStartopStart")
- _("CopyAgent:")
- _("mov ecx,1C0")
- _("clc")
- _("repe movsb")
- _("inc edx")
- _("jmp AgeoopStartopStart")
- _("AgeoopExit:opExit:")
- _("mov dword[Agenunt],edunt],edx")
- _("ljmndReturndReturn")
- EndFunc
- #EndRegion Modification
- #Region Assembler
- Func _($aasm)
- Local $lbuffer
- Select
- Case StringRight($aasm, 1) = ":"
- setvalue("Label_" & StringLeft($aasm, StringLen($aasm) - 1), $masmsize)
- Case StringInStr($aasm, "/") > 0
- setvalue("Label_" & StringLeft($aasm, StringInStr($aasm, "/") - 1), $masmsize)
- Local $loffset = StringRight($aasm, StringLen($aasm) - StringInStr($aasm, "/"))
- $masmsize += $loffset
- $masmcodeoffset += $loffset
- Case StringLeft($aasm, 5) = "nop x"
- $lbuffer = Int(Number(StringTrimLeft($aasm, 5)))
- $masmsize += $lbuffer
- For $i = 1 To $lbuffer
- $masmstring &= "90"
- Next
- Case StringLeft($aasm, 5) = "ljmp "
- $masmsize += 5
- $masmstring &= "E9{" & StringRight($aasm, StringLen($aasm) - 5) & "}"
- Case StringLeft($aasm, 5) = "ljne "
- $masmsize += 6
- $masmstring &= "0F85{" & StringRight($aasm, StringLen($aasm) - 5) & "}"
- Case StringLeft($aasm, 4) = "jmp " AND StringLen($aasm) > 7
- $masmsize += 2
- $masmstring &= "EB(" & StringRight($aasm, StringLen($aasm) - 4) & ")"
- Case StringLeft($aasm, 4) = "jae "
- $masmsize += 2
- $masmstring &= "73(" & StringRight($aasm, StringLen($aasm) - 4) & ")"
- Case StringLeft($aasm, 3) = "jz "
- $masmsize += 2
- $masmstring &= "74(" & StringRight($aasm, StringLen($aasm) - 3) & ")"
- Case StringLeft($aasm, 4) = "jnz "
- $masmsize += 2
- $masmstring &= "75(" & StringRight($aasm, StringLen($aasm) - 4) & ")"
- Case StringLeft($aasm, 4) = "jbe "
- $masmsize += 2
- $masmstring &= "76(" & StringRight($aasm, StringLen($aasm) - 4) & ")"
- Case StringLeft($aasm, 3) = "ja "
- $masmsize += 2
- $masmstring &= "77(" & StringRight($aasm, StringLen($aasm) - 3) & ")"
- Case StringLeft($aasm, 3) = "jl "
- $masmsize += 2
- $masmstring &= "7C(" & StringRight($aasm, StringLen($aasm) - 3) & ")"
- Case StringLeft($aasm, 4) = "jge "
- $masmsize += 2
- $masmstring &= "7D(" & StringRight($aasm, StringLen($aasm) - 4) & ")"
- Case StringLeft($aasm, 4) = "jle "
- $masmsize += 2
- $masmstring &= "7E(" & StringRight($aasm, StringLen($aasm) - 4) & ")"
- Case StringRegExp($aasm, "mov eax,dword[[][]{4,}[]]{4,}[]]")
- $masmsize += 5
- $masmstring &= "A1[" & StringMid($aasm, 15, StringLen($aasm) - 15) & "]"
- Case StringRegExp($aasm, "mov ebx,dword[[][]{4,}[]]{4,}[]]")
- $masmsize += 6
- $masmstring &= "8B1D[" & StringMid($aasm, 15, StringLen($aasm) - 15) & "]"
- Case StringRegExp($aasm, "mov ecx,dword[[][]{4,}[]]{4,}[]]")
- $masmsize += 6
- $masmstring &= "8B0D[" & StringMid($aasm, 15, StringLen($aasm) - 15) & "]"
- Case StringRegExp($aasm, "mov edx,dword[[][]{4,}[]]{4,}[]]")
- $masmsize += 6
- $masmstring &= "8B15[" & StringMid($aasm, 15, StringLen($aasm) - 15) & "]"
- Case StringRegExp($aasm, "mov esi,dword[[][]{4,}[]]{4,}[]]")
- $masmsize += 6
- $masmstring &= "8B35[" & StringMid($aasm, 15, StringLen($aasm) - 15) & "]"
- Case StringRegExp($aasm, "mov edi,dword[[][]{4,}[]]{4,}[]]")
- $masmsize += 6
- $masmstring &= "8B3D[" & StringMid($aasm, 15, StringLen($aasm) - 15) & "]"
- Case StringRegExp($aasm, "cmp ebx,dword\[Z]{4,}\Z]{4,}\]")
- $masmsize += 6
- $masmstring &= "3B1D[" & StringMid($aasm, 15, StringLen($aasm) - 15) & "]"
- Case StringRegExp($aasm, "lea eax,dword[[]ecx[]{4,}[]]{4,}[]]{4,}[]]")
- $masmsize += 7
- $masmstring &= "8D04CD[" & StringMid($aasm, 21, StringLen($aasm) - 21) & "]"
- Case StringRegExp($aasm, "leaord\[ewor+Z]{4,}\Z]{4,}\]]{4,}\]")
- $masmsize += 7
- $masmstring &= "8D3C15[" & StringMid($aasm, 19, StringLen($aasm) - 19) & "]"
- Case StringRegExp($aasm, "cmp dword[[][a-z,A-]digit:]digit:]digit:]]")
- $lbuffer = StringInStr($aasm, ",")
- $lbuffer = asmnumber(StringMid($aasm, $lbuffer + 1), True)
- If @extended Then
- $masmsize += 7
- $masmstring &= "833D[" & StringMid($aasm, 11, StringInStr($aasm, ",") - 12) & "]" & $lbuffer
- Else
- $masmsize += 10
- $masmstring &= "813D[" & StringMid($aasm, 11, StringInStr($aasm, ",") - 12) & "]" & $lbuffer
- EndIf
- Case StringRegExp($aasm, "cmp ecA-Z]{4,}-Z]{4,}") AND StringInStr($aasm, ",dword") = 0
- $masmsize += 6
- $masmstring &= "81F9[" & StringRight($aasm, StringLen($aasm) - 8) & "]"
- Case StringRegExp($aasm, "cmp ebA-Z]{4,}-Z]{4,}") AND StringInStr($aasm, ",dword") = 0
- $masmsize += 6
- $masmstring &= "81FB[" & StringRight($aasm, StringLen($aasm) - 8) & "]"
- Case StringRegExp($aasm, "cmp eaA-Z]{4,}-Z]{4,}") AND StringInStr($aasm, ",dword") = 0
- $masmsize += 5
- $masmstring &= "3D[" & StringRight($aasm, StringLen($aasm) - 8) & "]"
- Case StringRegExp($aasm, "add eaA-Z]{4,}-Z]{4,}") AND StringInStr($aasm, ",dword") = 0
- $masmsize += 5
- $masmstring &= "05[" & StringRight($aasm, StringLen($aasm) - 8) & "]"
- Case StringRegExp($aasm, "mov eaA-Z]{4,}-Z]{4,}") AND StringInStr($aasm, ",dword") = 0
- $masmsize += 5
- $masmstring &= "B8[" & StringRight($aasm, StringLen($aasm) - 8) & "]"
- Case StringRegExp($aasm, "mov ebA-Z]{4,}-Z]{4,}") AND StringInStr($aasm, ",dword") = 0
- $masmsize += 5
- $masmstring &= "BB[" & StringRight($aasm, StringLen($aasm) - 8) & "]"
- Case StringRegExp($aasm, "mov esA-Z]{4,}-Z]{4,}") AND StringInStr($aasm, ",dword") = 0
- $masmsize += 5
- $masmstring &= "BE[" & StringRight($aasm, StringLen($aasm) - 8) & "]"
- Case StringRegExp($aasm, "mov edA-Z]{4,}-Z]{4,}") AND StringInStr($aasm, ",dword") = 0
- $masmsize += 5
- $masmstring &= "BF[" & StringRight($aasm, StringLen($aasm) - 8) & "]"
- Case StringRegExp($aasm, "mov edA-Z]{4,}-Z]{4,}") AND StringInStr($aasm, ",dword") = 0
- $masmsize += 5
- $masmstring &= "BA[" & StringRight($aasm, StringLen($aasm) - 8) & "]"
- Case StringRegExp($aasm, "mov dword[[][a-z,}[]],ec}[]],ecx")
- $masmsize += 6
- $masmstring &= "890D[" & StringMid($aasm, 11, StringLen($aasm) - 15) & "]"
- Case StringRegExp($aasm, "fstp dword[[][]{4,}[]]{4,}[]]")
- $masmsize += 6
- $masmstring &= "D91D[" & StringMid($aasm, 12, StringLen($aasm) - 12) & "]"
- Case StringRegExp($aasm, "mov dword[[][a-z,}[]],ed}[]],edx")
- $masmsize += 6
- $masmstring &= "8915[" & StringMid($aasm, 11, StringLen($aasm) - 15) & "]"
- Case StringRegExp($aasm, "mov dword[[][a-z,}[]],ea}[]],eax")
- $masmsize += 5
- $masmstring &= "A3[" & StringMid($aasm, 11, StringLen($aasm) - 15) & "]"
- Case StringRegExp($aasm, "lea eax,dword[[]edx[]{4,}[]]{4,}[]]{4,}[]]")
- $masmsize += 7
- $masmstring &= "8D0495[" & StringMid($aasm, 21, StringLen($aasm) - 21) & "]"
- Case StringRegExp($aasm, "mov eax,dword[[]ecx[]{4,}[]]{4,}[]]{4,}[]]")
- $masmsize += 7
- $masmstring &= "8B048D[" & StringMid($aasm, 21, StringLen($aasm) - 21) & "]"
- Case StringRegExp($aasm, "mov ecx,dword[[]ecx[]{4,}[]]{4,}[]]{4,}[]]")
- $masmsize += 7
- $masmstring &= "8B0C8D[" & StringMid($aasm, 21, StringLen($aasm) - 21) & "]"
- Case StringRegExp($aasm, "push dword[[][]{4,}[]]{4,}[]]")
- $masmsize += 6
- $masmstring &= "FF35[" & StringMid($aasm, 12, StringLen($aasm) - 12) & "]"
- Case StringRegExp($aasm, "push Z]{4,}\z]{4,}\z")
- $masmsize += 5
- $masmstring &= "68[" & StringMid($aasm, 6, StringLen($aasm) - 5) & "]"
- Case StringRegExp($aasm, "call dword[[][]{4,}[]]{4,}[]]")
- $masmsize += 6
- $masmstring &= "FF15[" & StringMid($aasm, 12, StringLen($aasm) - 12) & "]"
- Case StringLeft($aasm, 5) = "call " AND StringLen($aasm) > 8
- $masmsize += 5
- $masmstring &= "E8{" & StringMid($aasm, 6, StringLen($aasm) - 5) & "}"
- Case StringRegExp($aasm, "mov dword\[[a-z,A-Z]{4,}x]{1,8}\]{1,8}\]{1,8}\z")
- $lbuffer = StringInStr($aasm, ",")
- $masmsize += 10
- $masmstring &= "C705[" & StringMid($aasm, 11, $lbuffer - 12) & "]" & asmnumber(StringMid($aasm, $lbuffer + 1))
- Case StringRegExp($aasm, "push [-[:x]{1,8}\]{1,8}\z")
- $lbuffer = asmnumber(StringMid($aasm, 6), True)
- If @extended Then
- $masmsize += 2
- $masmstring &= "6A" & $lbuffer
- Else
- $masmsize += 5
- $masmstring &= "68" & $lbuffer
- EndIf
- Case StringRegExp($aasm, "mov eax,[-[:x]{1,8}\]{1,8}\z")
- $masmsize += 5
- $masmstring &= "B8" & asmnumber(StringMid($aasm, 9))
- Case StringRegExp($aasm, "mov ebx,[-[:x]{1,8}\]{1,8}\z")
- $masmsize += 5
- $masmstring &= "BB" & asmnumber(StringMid($aasm, 9))
- Case StringRegExp($aasm, "mov ecx,[-[:x]{1,8}\]{1,8}\z")
- $masmsize += 5
- $masmstring &= "B9" & asmnumber(StringMid($aasm, 9))
- Case StringRegExp($aasm, "mov edx,[-[:x]{1,8}\]{1,8}\z")
- $masmsize += 5
- $masmstring &= "BA" & asmnumber(StringMid($aasm, 9))
- Case StringRegExp($aasm, "add eax,[-[:x]{1,8}\]{1,8}\z")
- $lbuffer = asmnumber(StringMid($aasm, 9), True)
- If @extended Then
- $masmsize += 3
- $masmstring &= "83C0" & $lbuffer
- Else
- $masmsize += 5
- $masmstring &= "05" & $lbuffer
- EndIf
- Case StringRegExp($aasm, "add ebx,[-[:x]{1,8}\]{1,8}\z")
- $lbuffer = asmnumber(StringMid($aasm, 9), True)
- If @extended Then
- $masmsize += 3
- $masmstring &= "83C3" & $lbuffer
- Else
- $masmsize += 6
- $masmstring &= "81C3" & $lbuffer
- EndIf
- Case StringRegExp($aasm, "add ecx,[-[:x]{1,8}\]{1,8}\z")
- $lbuffer = asmnumber(StringMid($aasm, 9), True)
- If @extended Then
- $masmsize += 3
- $masmstring &= "83C1" & $lbuffer
- Else
- $masmsize += 6
- $masmstring &= "81C1" & $lbuffer
- EndIf
- Case StringRegExp($aasm, "add edx,[-[:x]{1,8}\]{1,8}\z")
- $lbuffer = asmnumber(StringMid($aasm, 9), True)
- If @extended Then
- $masmsize += 3
- $masmstring &= "83C2" & $lbuffer
- Else
- $masmsize += 6
- $masmstring &= "81C2" & $lbuffer
- EndIf
- Case StringRegExp($aasm, "add edi,[-[:x]{1,8}\]{1,8}\z")
- $lbuffer = asmnumber(StringMid($aasm, 9), True)
- If @extended Then
- $masmsize += 3
- $masmstring &= "83C7" & $lbuffer
- Else
- $masmsize += 6
- $masmstring &= "81C7" & $lbuffer
- EndIf
- Case StringRegExp($aasm, "cmp ebx,[-[:x]{1,8}\]{1,8}\z")
- $lbuffer = asmnumber(StringMid($aasm, 9), True)
- If @extended Then
- $masmsize += 3
- $masmstring &= "83FB" & $lbuffer
- Else
- $masmsize += 6
- $masmstring &= "81FB" & $lbuffer
- EndIf
- Case Else
- Local $lopcode
- Switch $aasm
- Case "nop"
- $lopcode = "90"
- Case "pushad"
- $lopcode = "60"
- Case "popad"
- $lopcode = "61"
- Case "movord[eax]rd[eax]"
- $lopcode = "8B18"
- Case "test eax,eax"
- $lopcode = "85C0"
- Case "test ebx,ebx"
- $lopcode = "85DB"
- Case "test ecx,ecx"
- $lopcode = "85C9"
- Case "mov dword[eax],0"
- $lopcode = "C70000000000"
- Case "push eax"
- $lopcode = "50"
- Case "push ebx"
- $lopcode = "53"
- Case "push ecx"
- $lopcode = "51"
- Case "push edx"
- $lopcode = "52"
- Case "push ebp"
- $lopcode = "55"
- Case "push esi"
- $lopcode = "56"
- Case "push edi"
- $lopcode = "57"
- Case "jmp ebx"
- $lopcode = "FFE3"
- Case "pop eax"
- $lopcode = "58"
- Case "pop ebx"
- $lopcode = "5B"
- Case "pop edx"
- $lopcode = "5A"
- Case "pop ecx"
- $lopcode = "59"
- Case "pop esi"
- $lopcode = "5E"
- Case "inc eax"
- $lopcode = "40"
- Case "inc ecx"
- $lopcode = "41"
- Case "inc ebx"
- $lopcode = "43"
- Case "dec edx"
- $lopcode = "4A"
- Case "mov edi,edx"
- $lopcode = "8BFA"
- Case "mov ecx,esi"
- $lopcode = "8BCE"
- Case "mov ecx,edi"
- $lopcode = "8BCF"
- Case "xor eax,eax"
- $lopcode = "33C0"
- Case "xor ecx,ecx"
- $lopcode = "33C9"
- Case "xor edx,edx"
- $lopcode = "33D2"
- Case "xor ebx,ebx"
- $lopcode = "33DB"
- Case "mov edx,eax"
- $lopcode = "8BD0"
- Case "mov ebp,esp"
- $lopcode = "8BEC"
- Case "sub esp,8"
- $lopcode = "83EC08"
- Case "sub esp,14"
- $lopcode = "83EC14"
- Case "cmp ecx,4"
- $lopcode = "83F904"
- Case "cmp ecx,32"
- $lopcode = "83F932"
- Case "cmp ecx,3C"
- $lopcode = "83F93C"
- Case "mov ecx,edx"
- $lopcode = "8BCA"
- Case "mov eax,ecx"
- $lopcode = "8BC1"
- Case "mov ed[ebp+8][ebp+8]"
- $lopcode = "8B4D08"
- Case "mov ecxesp+1F4]sp+1F4]"
- $lopcode = "8B8C24F4010000"
- Case "mov ed[edi+4][edi+4]"
- $lopcode = "8B4F04"
- Case "mov ed[edi+8][edi+8]"
- $lopcode = "8B4F08"
- Case "mov ed[edi+4][edi+4]"
- $lopcode = "8B4704"
- Case "mov dx+4],ecx+4],ecx"
- $lopcode = "894804"
- Case "mov dx+8],ecx+8],ecx"
- $lopcode = "894808"
- Case "mov dx+C],ecx+C],ecx"
- $lopcode = "89480C"
- Case "mov dw+10],eax10],eax"
- $lopcode = "894610"
- Case "movord[edi]rd[edi]"
- $lopcode = "8B0F"
- Case "moveax],ecxax],ecx"
- $lopcode = "8908"
- Case "moveax],ebxax],ebx"
- $lopcode = "8918"
- Case "mov ed[eax+4][eax+4]"
- $lopcode = "8B5004"
- Case "mov ed[eax+c][eax+c]"
- $lopcode = "8B500C"
- Case "mov ed[esi+1c]esi+1c]"
- $lopcode = "8B561C"
- Case "pud[eax+8][eax+8]"
- $lopcode = "FF7008"
- Case "lea ea[eax+18]eax+18]"
- $lopcode = "8D4018"
- Case "lea ed[eax+4][eax+4]"
- $lopcode = "8D4804"
- Case "lea ed[eax+4][eax+4]"
- $lopcode = "8D5004"
- Case "lea ed[eax+8][eax+8]"
- $lopcode = "8D5008"
- Case "mov ed[eax+4][eax+4]"
- $lopcode = "8B4804"
- Case "mov ed[eax+8][eax+8]"
- $lopcode = "8B4808"
- Case "mov ed[eax+8][eax+8]"
- $lopcode = "8B4008"
- Case "mov ed[eax+4][eax+4]"
- $lopcode = "8B4004"
- Case "pud[eax+4][eax+4]"
- $lopcode = "FF7004"
- Case "pud[eax+c][eax+c]"
- $lopcode = "FF700C"
- Case "mov esp,ebp"
- $lopcode = "8BE5"
- Case "mov esp,ebp"
- $lopcode = "8BE5"
- Case "pop ebp"
- $lopcode = "5D"
- Case "retn 10"
- $lopcode = "C21000"
- Case "cmp eax,2"
- $lopcode = "83F802"
- Case "cmp eax,0"
- $lopcode = "83F800"
- Case "cmp eax,B"
- $lopcode = "83F80B"
- Case "cmp eax,200"
- $lopcode = "3D00020000"
- Case "shl eax,4"
- $lopcode = "C1E004"
- Case "shl eax,8"
- $lopcode = "C1E008"
- Case "shl eax,6"
- $lopcode = "C1E006"
- Case "shl eax,7"
- $lopcode = "C1E007"
- Case "shl eax,8"
- $lopcode = "C1E008"
- Case "shl eax,9"
- $lopcode = "C1E009"
- Case "mov edi,eax"
- $lopcode = "8BF8"
- Case "mov dx,word[ecx]"
- $lopcode = "668B11"
- Case "mov dx,word[edx]"
- $lopcode = "668B12"
- Case "mov word[eax],dx"
- $lopcode = "668910"
- Case "test dx,dx"
- $lopcode = "6685D2"
- Case "cmp word[edx],0"
- $lopcode = "66833A00"
- Case "cmp eax,ebx"
- $lopcode = "3BC3"
- Case "cmp eax,ecx"
- $lopcode = "3BC1"
- Case "mov ed[esi+8][esi+8]"
- $lopcode = "8B4608"
- Case "movord[eax]rd[eax]"
- $lopcode = "8B08"
- Case "mov ebx,edi"
- $lopcode = "8BDF"
- Case "mov ebx,eax"
- $lopcode = "8BD8"
- Case "mov eax,edi"
- $lopcode = "8BC7"
- Case "mov al,byte[ebx]"
- $lopcode = "8A03"
- Case "test al,al"
- $lopcode = "84C0"
- Case "movord[ecx]rd[ecx]"
- $lopcode = "8B01"
- Case "lea ecxeax+180]ax+180]"
- $lopcode = "8D8880010000"
- Case "mov eb[ecx+14]ecx+14]"
- $lopcode = "8B5914"
- Case "mov ed[ebx+c][ebx+c]"
- $lopcode = "8B430C"
- Case "mov ecx,eax"
- $lopcode = "8BC8"
- Case "cmp eax,-1"
- $lopcode = "83F8FF"
- Case "mov al,byte[ecx]"
- $lopcode = "8A01"
- Case "movord[edx]rd[edx]"
- $lopcode = "8B1A"
- Case "lea ediedx+ebx]dx+ebx]"
- $lopcode = "8D3C1A"
- Case "mov ah,byte[edi]"
- $lopcode = "8A27"
- Case "cmp al,ah"
- $lopcode = "3AC4"
- Case "mov dword[edx],0"
- $lopcode = "C70200000000"
- Case "movebx],ecxbx],ecx"
- $lopcode = "890B"
- Case "cmp edx,esi"
- $lopcode = "3BD6"
- Case "cmp ecx,900000"
- $lopcode = "81F900009000"
- Case "mov ed[edx+4][edx+4]"
- $lopcode = "8B7A04"
- Case "cmp ebx,edi"
- $lopcode = "3BDF"
- Case "movedx],ebxdx],ebx"
- $lopcode = "891A"
- Case "lea ed[edx+8][edx+8]"
- $lopcode = "8D7A08"
- Case "movedi],ecxdi],ecx"
- $lopcode = "890F"
- Case "retn"
- $lopcode = "C3"
- Case "mo[edx],-1edx],-1"
- $lopcode = "C702FFFFFFFF"
- Case "cmp eax,1"
- $lopcode = "83F801"
- Case "mov eaxebp+37c]bp+37c]"
- $lopcode = "8B857C030000"
- Case "mov eaxebp+338]bp+338]"
- $lopcode = "8B8538030000"
- Case "mov ecxebx+250]bx+250]"
- $lopcode = "8B8B50020000"
- Case "mov ecxebx+194]bx+194]"
- $lopcode = "8B8B94010000"
- Case "mov ec[ebx+18]ebx+18]"
- $lopcode = "8B5918"
- Case "mov ec[ebx+40]ebx+40]"
- $lopcode = "8B5940"
- Case "mov eb[ecx+10]ecx+10]"
- $lopcode = "8B5910"
- Case "mov eb[ecx+18]ecx+18]"
- $lopcode = "8B5918"
- Case "mov eb[ecx+4c]ecx+4c]"
- $lopcode = "8B594C"
- Case "movord[ebx]rd[ebx]"
- $lopcode = "8B0B"
- Case "mov edx,esp"
- $lopcode = "8BD4"
- Case "mov ecxebx+170]bx+170]"
- $lopcode = "8B8B70010000"
- Case "cmp ea[esi+9C]esi+9C]"
- $lopcode = "3B869C000000"
- Case "mov eb[ecx+20]ecx+20]"
- $lopcode = "8B5920"
- Case "movord[ecx]rd[ecx]"
- $lopcode = "8B09"
- Case "mov ea[ecx+40]ecx+40]"
- $lopcode = "8B4140"
- Case "mov ec[ecx+10]ecx+10]"
- $lopcode = "8B4910"
- Case "mov ec[ecx+18]ecx+18]"
- $lopcode = "8B4918"
- Case "mov ec[ecx+20]ecx+20]"
- $lopcode = "8B4920"
- Case "mov ec[ecx+4c]ecx+4c]"
- $lopcode = "8B494C"
- Case "mov ecxecx+170]cx+170]"
- $lopcode = "8B8970010000"
- Case "mov ecxecx+194]cx+194]"
- $lopcode = "8B8994010000"
- Case "mov ecxecx+250]cx+250]"
- $lopcode = "8B8950020000"
- Case "mov [ecx+4f]ecx+4f]"
- $lopcode = "8A414F"
- Case "mov [ecx+3f]ecx+3f]"
- $lopcode = "8A413F"
- Case "cmp al,f"
- $lopcode = "3C0F"
- Case "lea esi,di+ebx*4i+ebx*4]"
- $lopcode = "8D349E"
- Case "movord[esi]rd[esi]"
- $lopcode = "8B36"
- Case "test esi,esi"
- $lopcode = "85F6"
- Case "clc"
- $lopcode = "F8"
- Case "repe movsb"
- $lopcode = "F3A4"
- Case "inc edx"
- $lopcode = "42"
- Case Else
- MsgBox(0, "ASM", "Couldsemble: emble: " & $aasm)
- Exit
- EndSwitch
- $masmsize += 0.5 * StringLen($lopcode)
- $masmstring &= $lopcode
- EndSelect
- EndFunc
- Func completeasmcode()
- Local $linexpression = False
- Local $lexpression
- Local $ltempasm = $masmstring
- Local $lcurrentoffset = Dec(Hex($mmemory)) + $masmcodeoffset
- Local $ltoken
- For $i = 1 To $mlabels[0][0]
- If StringLeft($mlabels[$i][0], 6) = "Label_" Then
- $mlabels[$i][0] = StringTrimLeft($mlabels[$i][0], 6)
- $mlabels[$i][1] = $mmemory + $mlabels[$i][1]
- EndIf
- Next
- $masmstring = ""
- For $i = 1 To StringLen($ltempasm)
- $ltoken = StringMid($ltempasm, $i, 1)
- Switch $ltoken
- Case "(", "[", "{"
- $linexpression = True
- Case ")"
- $masmstring &= Hex(getlabelinfo($lexpression) - Int($lcurrentoffset) - 1, 2)
- $lcurrentoffset += 1
- $linexpression = False
- $lexpression = ""
- Case "]"
- $masmstring &= swapendian(Hex(getlabelinfo($lexpression), 8))
- $lcurrentoffset += 4
- $linexpression = False
- $lexpression = ""
- Case "}"
- $masmstring &= swapendian(Hex(getlabelinfo($lexpression) - Int($lcurrentoffset) - 4, 8))
- $lcurrentoffset += 4
- $linexpression = False
- $lexpression = ""
- Case Else
- If $linexpression Then
- $lexpression &= $ltoken
- Else
- $masmstring &= $ltoken
- $lcurrentoffset += 0.5
- EndIf
- EndSwitch
- Next
- EndFunc
- Func getlabelinfo($alabel)
- Local $lvalue = getvalue($alabel)
- If $lvalue = -1 Then Exit MsgBox(0, "Label", "Label: " & $alabel & " not provided")
- Return $lvalue
- EndFunc
- Func asmnumber($anumber, $asmall = False)
- If $anumber >= 0 Then
- $anumber = Dec($anumber)
- EndIf
- If $asmall AND $anumber <= 127 AND $anumber >= -128 Then
- Return SetExtended(1, Hex($anumber, 2))
- Else
- Return SetExtended(0, swapendian(Hex($anumber, 8)))
- EndIf
- EndFunc
- #EndRegion Assembler
- #EndRegion Other Functions
- Func __processgetname($i_pid)
- If NOT ProcessExists($i_pid) Then Return SetError(1, 0, "")
- If NOT @error Then
- Local $a_processes = ProcessList()
- For $i = 1 To $a_processes[0][0]
- If $a_processes[$i][1] = $i_pid Then Return $a_processes[$i][0]
- Next
- EndIf
- Return SetError(1, 0, "")
- EndFunc
- Func checkarea($ax, $ay)
- $ret = False
- $px = DllStructGetData(getagentbyid(-2), "X")
- $py = DllStructGetData(getagentbyid(-2), "Y")
- If ($px < $ax + 500) AND ($px > $ax - 500) AND ($py < $ay + 500) AND ($py > $ay - 500) Then
- $ret = True
- EndIf
- Return $ret
- EndFunc
- Func countiteminbagsbymodelid($itemmodelid)
- $count = 0
- For $i = $bag_backpack To $bag_bag2
- For $j = 1 To DllStructGetData(getbag($i), "Slots")
- $liteminfo = getitembyslot($i, $j)
- If DllStructGetData($liteminfo, "ModelID") = $itemmodelid Then $count += DllStructGetData($liteminfo, "quantity")
- Next
- Next
- Return $count
- EndFunc
- Func moveitemfromstoragebymodelid($amodelid, $amount = 250)
- Local $lbag
- Local $lreturnarray[2]
- Local $litem
- Local $lempackslotackslot
- Local $totalitems = 0
- Local $sttemcountemcount = 0
- Local $storagecount
- Local $newstack
- If countiteminbagsbymodelid($amodelid) >= $amount Then Return True
- For $i = 8 To 16
- $lbag = getbag($i)
- For $j = 1 To DllStructGetData($lbag, "Slots")
- $lempackslotackslot = findbackpackstack($amodelid)
- If NOT IsArray($lempackslotackslot) Then
- $lempackslotackslot = openbackpackslot()
- If NOT IsArray($lempackslotackslot) Then Return False
- Else
- $litem = getitembyslot($lempackslotackslot[0], $lempackslotackslot[1])
- $sttemcountemcount = DllStructGetData($litem, "Quantity")
- EndIf
- $litem = getitembyslot($lbag, $j)
- $storagecount = DllStructGetData($litem, "Quantity")
- If DllStructGetData($litem, "ModelID") == $amodelid Then
- $totalitems += $storagecount
- moveitem($litem, $lempackslotackslot[0], $lempackslotackslot[1])
- Sleep(getping() + Random(100, 150, 1))
- If $totalitems >= $amount Then Return True
- EndIf
- Next
- Next
- Return True
- EndFunc
- Func getitemfromstorageiflow($amodelid, $minimumamount = 250)
- Local $totalbackpackackpack = countiteminbagsbymodelid($amodelid)
- If $totalbackpackackpack < $minimumamount Then
- moveitemfromstoragebymodelid($amodelid, $minimumamount)
- EndIf
- EndFunc
- Opt("GUIOnEventMode", 1)
- #Region *Declarations*
- Global $iam = 0
- Global $iamblue = 1
- Global $iamred = 2
- Global $ha = 330
- Global $uw = 84
- Global $fetid = 593
- Global $burialmounds = 80
- Global $unholytemples = 79
- Global $forgottenshrines = 596
- Global $goldengates = 126
- Global $courtyard = 78
- Global $antechamber = 598
- Global $vault = 83
- Global $hoh = 75
- Global $iamwonuw
- Global $iamwonfetid
- Global $iamalmoundslmounds
- Global $iamwytemplestemples
- Global $iamwonfnshrinesshrines
- Global $iadengatesengates
- Global $iamwoncourtyard
- Global $fameup
- Global $savefame
- Global $lastbag = 3
- Global $offset = 900
- Global $gwpid
- Global $mzaishen
- Global $munderworld
- Global $mfetidriver
- Global $mburialmounds
- Global $munholytemples
- Global $mfnshrinesshrines
- Global $mgoldengates
- Global $mcourtyard
- Global $mantechamber
- Global $mhallofhero
- Global $intstarted = -1
- Global $runs = 0
- Global $lblwins = 0
- Global $zk = 0
- Global $itotalbalthazar = 0
- Global $imaalthazarlthazar = 0
- Global $mid_zkey = 28517
- Global $mid_hero_boxes = 36666
- Global $balthazarforval = "Zaishen Keys"
- Global $distance = getdistance(getnearestenemytoagent(-2))
- Global $ostats_fame = getherotitle()
- Global $i = 1
- Global $boolrun = False
- Global $boolinit = False
- Global $logfile = FileOpen("ChestLog.txt", 2)
- Global $rendering = True
- Global $chatstucktimer = TimerInit()
- Global $permasf = 0
- Global $usealchol = 0
- Global $wearedead = 0
- Global $error = 0
- Global Enum $insta_outpostoutpost, $instanceplorablelorable, $insta_loadingloading
- Global Enum $bag_backpack = 1, $bag_beltpouch, $bag_bag1, $bag_bag2, $bamentpackentpack, $bagmeditemseditems = 7, $bag_storage1, $bag_storage2, $bag_storage3, $bag_storage4, $bag_storage5, $bag_storage6, $bag_storage7, $bag_storage8, $bag_stoiversaryversary
- #EndRegion Declarations
- #Region GUI
- GUICreate("Multi-Ha TeqatleTeqatle", 354, 234, 0, 0)
- GUISetFont(-1, 9, 400, 0, "Arial")
- GUICtrlCreateGroup("", 8, 0, 121, 170)
- GUICtrlCreateLabel("Runs:", 16, 60, 55, 18)
- GUICtrlSetFont(-1, 9, 500, 0)
- GUICtrlSetColor(-1, 255)
- GUICtrlCreateLabel("Fame:", 16, 76, 55, 18)
- GUICtrlSetFont(-1, 9, 500, 0)
- GUICtrlSetColor(-1, 255)
- GUICtrlCreateLabel("Up:", 16, 92, 55, 18)
- GUICtrlSetFont(-1, 9, 500, 0)
- GUICtrlSetColor(-1, 255)
- GUICtrlCreateLabel("Zk uped:", 16, 108, 55, 18)
- GUICtrlSetFont(-1, 9, 500, 0)
- GUICtrlSetColor(-1, 255)
- GUICtrlCreateLabel("Zkeys:", 16, 124, 55, 18)
- GUICtrlSetFont(-1, 9, 500, 0)
- GUICtrlSetColor(-1, 255)
- GUICtrlCreateLabel("Boxes:", 16, 140, 55, 18)
- GUICtrlSetFont(-1, 9, 500, 0)
- GUICtrlSetColor(-1, 255)
- Global $nowinmap = GUICtrlCreateLabel("now in map", 10, 176, 120, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetFont(-1, 10, 700, 0)
- GUICtrlSetColor(-1, 16711680)
- Global $myboxesinbag = GUICtrlCreateLabel("0", 72, 140, 51, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetFont(-1, 9, 500, 0)
- GUICtrlSetColor(-1, 255)
- Global $myzkeysinbag = GUICtrlCreateLabel("0", 72, 124, 51, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetFont(-1, 9, 500, 0)
- GUICtrlSetColor(-1, 255)
- Global $lblzk = GUICtrlCreateLabel("0", 72, 108, 51, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetFont(-1, 9, 500, 0)
- GUICtrlSetColor(-1, 255)
- Global $lblwins = GUICtrlCreateLabel("0", 62, 92, 51, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetFont(-1, 9, 500, 0)
- GUICtrlSetColor(-1, 255)
- GUICtrlCreateLabel("/300", 102, 92, 25, 18)
- GUICtrlSetFont(-1, 9, 500, 0)
- GUICtrlSetColor(-1, 255)
- Global $lblfame = GUICtrlCreateLabel("0", 72, 76, 51, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetFont(-1, 9, 500, 0)
- GUICtrlSetColor(-1, 255)
- Global $lblruns = GUICtrlCreateLabel("0", 72, 60, 51, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetFont(-1, 9, 500, 0)
- GUICtrlSetColor(-1, 255)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- Global $console = GUICtrlCreateEdit("", 136, 0, 209, 120, BitOR(64, 2097152, 8388608, 2048))
- GUICtrlSetFont(-1, 9, 400, 0, "Arial")
- GUICtrlSetColor(-1, 65535)
- GUICtrlSetBkColor(-1, 0)
- GUICtrlSetCursor(-1, 5)
- GUICtrlCreateGroup("", 8, 190, 121, 33)
- GUICtrlSetState(-1, $gui_checked)
- Global $cbxhidegw = GUICtrlCreateCheckbox("Disable Graphics", 24, 200, 98, 17)
- GUICtrlSetOnEvent($cbxhidegw, "Init")
- Global $pause = GUICtrlCreateCheckbox("Pause", 70, 32, 50, 25)
- GUICtrlSetOnEvent($pause, "Pause")
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- GUICtrlCreateGroup("Was on maps", 136, 130, 209, 93, BitOR($gui_slt_groupt_group, $bs_center))
- GUICtrlCreateLabel("Underworld:", 140, 145, 70, 18)
- GUICtrlCreateLabel("Fetid River:", 140, 160, 70, 18)
- GUICtrlCreateLabel("Burial Mounds:", 140, 175, 70, 18)
- GUICtrlCreateLabel("Unholy Temples:", 140, 190, 100, 18)
- GUICtrlCreateLabel("ForShrines:hrines:", 140, 205, 100, 18)
- GUICtrlCreateLabel("Golden Gates:", 255, 150, 70, 18)
- GUICtrlCreateLabel("Courtyard:", 255, 165, 70, 18)
- GUICtrlCreateLabel("Antechamber:", 255, 180, 70, 18)
- GUICtrlCreateLabel("Hall of Hero:", 255, 195, 70, 18)
- Global $munderworld = GUICtrlCreateLabel("0", 225, 145, 30, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetColor(-1, 65280)
- Global $mfetidriver = GUICtrlCreateLabel("0", 225, 160, 30, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetColor(-1, 65280)
- Global $mburialmounds = GUICtrlCreateLabel("0", 225, 175, 30, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetColor(-1, 65280)
- Global $munholytemples = GUICtrlCreateLabel("0", 225, 190, 30, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetColor(-1, 16711680)
- Global $mfnshrinesshrines = GUICtrlCreateLabel("0", 225, 205, 30, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetColor(-1, 16711680)
- Global $mgoldengates = GUICtrlCreateLabel("0", 330, 150, 10, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetColor(-1, 16711680)
- Global $mcourtyard = GUICtrlCreateLabel("0", 330, 165, 10, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetColor(-1, 16711680)
- Global $mantechamber = GUICtrlCreateLabel("0", 330, 180, 10, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetColor(-1, 16711680)
- Global $mhallofhero = GUICtrlCreateLabel("0", 330, 195, 10, 18, BitOR($ss_center, $ss_centerimage))
- GUICtrlSetColor(-1, 16711680)
- Global $guistart = GUICtrlCreateButton("START", 8, 32, 60, 25)
- GUICtrlSetFont(-1, 9, 700, 0, "Arial")
- Global $guiname = GUICtrlCreateCombo("", 8, 8, 121, 25, BitOR($cbs_dropdown, $cbs_autohscroll))
- GUICtrlSetData(-1, getloggedcharnames())
- GUISetState(@SW_SHOW)
- GUISetOnEvent($gui_event_close, "CloseHandler")
- GUICtrlSetOnEvent($guistart, "Init")
- #EndRegion GUI
- setevent("SkillActivate", "", "", "", "")
- While 1
- Sleep(100)
- If $boolrun Then
- mainloop()
- EndIf
- WEnd
- While 1
- Sleep(100)
- If $boolrun Then
- $wearedead = 0
- start()
- If $wearedead = 0 Then zaishen()
- If $wearedead = 0 Then uw()
- If NOT $boolrun Then
- out("Bot was paused")
- EndIf
- EndIf
- WEnd
- Func init()
- Switch (@GUI_CtrlId)
- Case $guistart
- If $boolrun = False Then
- GUICtrlSetData($guistart, "...")
- GUICtrlSetState($guistart, $gui_enable)
- GUICtrlSetState($guiname, $gui_disable)
- initialize(GUICtrlRead($guiname), True, True)
- GUICtrlSetData($guistart, "Don't both workin working")
- $boolrun = True
- famesave()
- out("Bot started!")
- Else
- GUICtrlSetData($guistart, "You had k it -_- it -_-")
- GUICtrlSetState($guistart, $gui_disable)
- $boolrun = False
- EndIf
- Case $cbxhidegw
- If GUICtrlRead($cbxhidegw) = 1 Then
- disablerendering()
- WinSetState(getwindowhandle(), "", @SW_HIDE)
- Else
- enablerendering()
- WinSetState(getwindowhandle(), "", @SW_SHOW)
- EndIf
- Case $gui_event_close
- Exit
- EndSwitch
- EndFunc
- Func mainloop()
- If getmaploading() == $insta_outpostoutpost Then start()
- If getmaploading() == $instanceplorablelorable AND getmapid() == $ha Then zaishen()
- If getmapid() == $uw Then uw()
- If getmapid() == $fetid Then fetid()
- If getmapid() == $burialmounds Then burialmounds()
- If getmapid() == $unholytemples Then unholytemples()
- If getmapid() == $forgottenshrines Then forgottenshrines()
- If getmapid() == $goldengates Then goldengates()
- If getmapid() == $courtyard Then courtyard()
- If getmapid() == $antechamber Then antechamber()
- If getmapid() == $vault Then vault()
- If getmapid() == $hoh Then hoh()
- EndFunc
- Func start()
- If getmaploading() == $insta_outpostoutpost AND getmapid() == $ha Then
- If GUICtrlRead($pause) = 1 Then
- out("Bot paused")
- Sleep(2000)
- Else
- GUICtrlSetData($nowinmap, "Out post HA")
- titlecheck()
- zkeys()
- GUICtrlSetData($myboxesinbag, countiteminbagsbymodelid($mid_hero_boxes))
- GUICtrlSetData($myzkeysinbag, countiteminbagsbymodelid($mid_zkey))
- If geteffecttimeremaining(2546) > 0 Then
- out("Wait fonorable.orable.")
- Sleep(geteffecttimeremaining(2546) + 2000)
- EndIf
- Do
- If getmapid() <> $ha Then
- out("Tr outpostoutpost")
- waitmaploading()
- EndIf
- Until getmapid() = $ha
- GUICtrlSetData($lblruns, GUICtrlRead($lblruns) + 1)
- $runs += 1
- out("Starting Run # " & $runs)
- out("Add henchs")
- addnpc(17)
- addnpc(12)
- addnpc(13)
- addnpc(14)
- addnpc(6)
- addnpc(7)
- addnpc(8)
- enterchallenge()
- waitmaploading()
- EndIf
- EndIf
- EndFunc
- Func zaishen()
- GUICtrlSetData($nowinmap, "Zaishen Map")
- While getmaploading() == $instanceplorablelorable AND getmapid() == $ha
- If GUICtrlRead($pause) = 1 Then
- out("Bot paused")
- Sleep(2000)
- Else
- checkisteamwiped()
- $agent = getnearestenemytoagent()
- $distance = getdistance($agent, -2)
- $besttarget = getbesttarget()
- $elementalist = getagentbyname("Zaishentalistntalist")
- If $distance > 1300 AND $distance < 8000 Then
- If getmaploading() == $instanceplorablelorable AND getmapid() == $ha Then
- attack($agent)
- out("HPt enemy: enemy:")
- calltarget($agent)
- changetarget($agent)
- Sleep(2000)
- EndIf
- EndIf
- If $distance < 2000 Then
- If getmaploading() == $instanceplorablelorable AND getmapid() == $ha Then
- killenemy()
- EndIf
- EndIf
- If getnearestenemytoagent() = 0 Then
- If getmaploading() == $instanceplorablelorable AND getmapid() == $ha Then
- out("Waitloading:oading:")
- waitmaploading()
- EndIf
- EndIf
- If getmaploading() == $insta_outpostoutpost AND getmapid() == $ha Then
- Return mainloop()
- EndIf
- EndIf
- WEnd
- EndFunc
- Func uw()
- GUICtrlSetData($nowinmap, "Underworld")
- $iamwonuw = getherotitle()
- skipcinematic()
- While getmaploading() == $instanceplorablelorable AND getmapid() == $uw
- $agent = getnearestenemytoagent()
- $distance = getdistance($agent, -2)
- $besttarget = getbesttarget()
- checkisteamwiped()
- If $iamwonuw == getherotitle() Then
- If getnearestenemytoagent() = 0 Then
- If getisliving(getmyid()) Then
- If getmapid() == $uw Then
- out("fight in UW")
- Sleep(1000)
- move(67, -3341)
- EndIf
- EndIf
- EndIf
- EndIf
- If $iamwonuw == getherotitle() Then
- If $distance > 1250 AND $distance < 8000 Then
- If getisliving(getmyid()) Then
- If getmapid() == $uw Then
- attack($agent)
- Sleep(1500)
- EndIf
- EndIf
- EndIf
- EndIf
- If $iamwonuw == getherotitle() Then
- If $distance < 1250 Then
- If getisliving(getmyid()) Then
- If getmapid() == $uw Then
- killenemy()
- EndIf
- EndIf
- EndIf
- EndIf
- If $iamwonuw < getherotitle() Then
- If getmapid() == $uw Then
- out("won in UW")
- fameup()
- Sleep(5000)
- waitmaploading()
- EndIf
- EndIf
- WEnd
- GUICtrlSetData($munderworld, GUICtrlRead($munderworld) + 1)
- EndFunc
- Func fetid()
- GUICtrlSetData($nowinmap, "Fetid River")
- skipcinematic()
- titlecheck()
- $iamwonfetid = getherotitle()
- While getmaploading() == $instanceplorablelorable AND getmapid() == $fetid
- $agent = getnearestenemytoagent()
- $distance = getdistance($agent, -2)
- $besttarget = getbesttarget()
- checkisteamwiped()
- If $iamwonfetid == getherotitle() Then
- If $distance > 1250 AND $distance < 8000 Then
- If getisliving(getmyid()) Then
- If getmapid() == $fetid Then
- out("fight in Fetid")
- attack($agent)
- Sleep(1500)
- EndIf
- EndIf
- EndIf
- EndIf
- If $iamwonfetid == getherotitle() Then
- If $distance < 1250 Then
- If getisliving(getmyid()) Then
- If getmapid() == $fetid Then
- out("killing in Fetid")
- killenemy()
- EndIf
- EndIf
- EndIf
- EndIf
- If $iamwonfetid < getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $fetid Then
- out("won in Fetid")
- fameup()
- Sleep(5000)
- waitmaploading()
- EndIf
- EndIf
- EndIf
- WEnd
- GUICtrlSetData($mfetidriver, GUICtrlRead($mfetidriver) + 1)
- EndFunc
- Func burialmounds()
- GUICtrlSetData($nowinmap, "Burial Mounds")
- skipcinematic()
- titlecheck()
- $iamalmoundslmounds = getherotitle()
- While getmaploading() == $instanceplorablelorable AND getmapid() == $burialmounds
- $agent = getnearestenemytoagent()
- $distance = getdistance($agent, -2)
- $besttarget = getbesttarget()
- checkisteamwiped()
- If $iamalmoundslmounds == getherotitle() Then
- If getnearestenemytoagent() = 0 Then
- If getisliving(getmyid()) Then
- If getmapid() == $burialmounds Then
- out("lf enemes")
- Sleep(1000)
- move(-4214, 3251)
- EndIf
- EndIf
- EndIf
- EndIf
- If $iamalmoundslmounds == getherotitle() Then
- If $distance > 1250 AND $distance < 10000 Then
- If getisliving(getmyid()) Then
- If getmapid() == $burialmounds Then
- out("fight in Byrial")
- attack($agent)
- Sleep(1500)
- EndIf
- EndIf
- EndIf
- EndIf
- If $iamalmoundslmounds == getherotitle() Then
- If $distance < 1250 Then
- If getisliving(getmyid()) Then
- If getmapid() == $burialmounds Then
- out("Kin Byrial Byrial")
- killenemy()
- EndIf
- EndIf
- EndIf
- EndIf
- If $iamalmoundslmounds < getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $burialmounds Then
- out("won in Burial")
- fameup()
- Sleep(5000)
- waitmaploading()
- EndIf
- EndIf
- EndIf
- WEnd
- GUICtrlSetData($mburialmounds, GUICtrlRead($mburialmounds) + 1)
- EndFunc
- Func unholytemples()
- GUICtrlSetData($nowinmap, "Unholy Temples")
- skipcinematic()
- titlecheck()
- $iamwytemplestemples = getherotitle()
- checkcolor()
- While getmaploading() == $instanceplorablelorable AND getmapid() == $unholytemples
- If $iam = $iamblue Then
- unholyblue()
- If $iamwytemplestemples < getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $unholytemples Then
- out("won in Unholy")
- Sleep(5000)
- waitmaploading()
- EndIf
- EndIf
- EndIf
- EndIf
- If $iam = $iamred Then
- unholyred()
- If $iamwytemplestemples < getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $unholytemples Then
- out("won in Unholy")
- fameup()
- Sleep(5000)
- waitmaploading()
- EndIf
- EndIf
- EndIf
- EndIf
- WEnd
- GUICtrlSetData($munholytemples, GUICtrlRead($munholytemples) + 1)
- EndFunc
- Func unholyblue()
- $ghostly1 = getnearestnpctocoords(1883, 2328)
- $iamwytemplestemples = getherotitle()
- checkisteamwiped()
- $nearestnps = getnearestagenttoagent()
- If $iamwytemplestemples == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $unholytemples Then
- out("run blue relicks")
- moveto(-667, -331)
- EndIf
- EndIf
- EndIf
- If $iamwytemplestemples == getherotitle() AND checkarea(-667, -331) Then
- If getisliving(getmyid()) Then
- If getmapid() == $unholytemples Then
- moveto(-2233, -2047)
- EndIf
- EndIf
- EndIf
- If $iamwytemplestemples == getherotitle() AND checkarea(-2233, -2047) Then
- If getisliving(getmyid()) Then
- If getmapid() == $unholytemples Then
- pickuploot()
- Sleep(1000)
- moveto(-667, -331)
- EndIf
- EndIf
- EndIf
- If $iamwytemplestemples == getherotitle() AND checkarea(-667, -331) Then
- If getisliving(getmyid()) Then
- If getmapid() == $unholytemples Then
- moveto(1549, 1519)
- commandall(-3107, -2996)
- gotonpc($ghostly1)
- Sleep(2000)
- EndIf
- EndIf
- EndIf
- EndFunc
- Func unholyred()
- $ghostly2 = getnearestnpctocoords(-3052, -3041)
- $iamwytemplestemples = getherotitle()
- checkisteamwiped()
- $nearestnps = getnearestagenttoagent()
- If $iamwytemplestemples == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $unholytemples Then
- out("run red relicks")
- moveto(-667, -331)
- EndIf
- EndIf
- EndIf
- If $iamwytemplestemples == getherotitle() AND checkarea(-667, -331) Then
- If getisliving(getmyid()) Then
- If getmapid() == $unholytemples Then
- moveto(868, 1666)
- EndIf
- EndIf
- EndIf
- If $iamwytemplestemples == getherotitle() AND checkarea(868, 1666) Then
- If getisliving(getmyid()) Then
- If getmapid() == $unholytemples Then
- pickuploot()
- Sleep(1000)
- moveto(-667, -331)
- EndIf
- EndIf
- EndIf
- If $iamwytemplestemples == getherotitle() AND checkarea(-667, -331) Then
- If getisliving(getmyid()) Then
- If getmapid() == $unholytemples Then
- moveto(-2855, -1646)
- moveto(-3107, -2996)
- commandall(1549, 1519)
- gotonpc($ghostly2)
- Sleep(2000)
- EndIf
- EndIf
- EndIf
- EndFunc
- Func forgottenshrines()
- GUICtrlSetData($nowinmap, "Fo ShrinesShrines")
- skipcinematic()
- titlecheck()
- $iamwonfnshrinesshrines = getherotitle()
- $ghostlyblue = getnearestnpctocoords(-1910, -3490)
- $ghostlyred = getnearestnpctocoords(1950, -3435)
- checkcolor()
- If getmaploading() == $instanceplorablelorable AND getmapid() == $forgottenshrines Then
- If $iam == $iamblue Then
- gotonpc($ghostlyblue)
- Sleep(1000)
- EndIf
- EndIf
- If getmaploading() == $instanceplorablelorable AND getmapid() == $forgottenshrines Then
- If $iam == $iamred Then
- gotonpc($ghostlyred)
- Sleep(1000)
- EndIf
- EndIf
- Global $startblue = 0
- Global $startred = 0
- While getmaploading() == $instanceplorablelorable AND getmapid() == $forgottenshrines
- If $iam == $iamblue Then
- out("I am blue")
- checkisteamwiped()
- $agent = getnearestenemytoagent()
- $distance = getdistance($agent, -2)
- $besttarget = getbesttarget()
- If $startblue = 0 Then
- If $iamwonfnshrinesshrines == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $forgottenshrines Then
- commandall(-949, 946)
- Do
- If getisdead(getmyid()) Then ExitLoop
- If $iamwonfnshrinesshrines < getherotitle() Then ExitLoop
- move(-2227, -1405)
- Sleep(2000)
- Until checkarea(-2227, -1405)
- EndIf
- EndIf
- EndIf
- EndIf
- If $iamwonfnshrinesshrines == getherotitle() AND checkarea(-2227, -1405) AND getmapid() == $forgottenshrines Then
- If getisliving(getmyid()) Then
- Sleep(15000)
- moveto(-949, 946)
- $startblue = 1
- EndIf
- EndIf
- If $iamwonfnshrinesshrines == getherotitle() AND checkarea(-949, 946) AND getmapid() == $forgottenshrines Then
- If getisliving(getmyid()) Then
- Sleep(15000)
- commandall(11, 3664)
- moveto(11, 3664)
- EndIf
- EndIf
- If $iamwonfnshrinesshrines == getherotitle() AND checkarea(11, 3664) AND getmapid() == $forgottenshrines Then
- If getisliving(getmyid()) Then
- Sleep(15000)
- commandall(606, 928)
- moveto(606, 928)
- EndIf
- EndIf
- If $iamwonfnshrinesshrines == getherotitle() AND checkarea(606, 928) AND getmapid() == $forgottenshrines Then
- If getisliving(getmyid()) Then
- Sleep(15000)
- commandall(2063, -1375)
- moveto(2063, -1375)
- EndIf
- EndIf
- If $startblue = 1 Then
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then Sleep(20000)
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then commandall(606, 928)
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then Sleep(20000)
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then commandall(11, 3664)
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then Sleep(20000)
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then commandall(-949, 946)
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then Sleep(20000)
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then commandall(2063, -1375)
- EndIf
- If $iamwonfnshrinesshrines < getherotitle() AND getmapid() == $forgottenshrines Then
- If getisliving(getmyid()) Then
- If getmapid() == $forgottenshrines Then
- out("won in FS")
- Sleep(5000)
- waitmaploading()
- EndIf
- EndIf
- EndIf
- EndIf
- If $iam == $iamred Then
- out("I am red")
- checkisteamwiped()
- $agent = getnearestenemytoagent()
- $distance = getdistance($agent, -2)
- $besttarget = getbesttarget()
- If $startred = 0 Then
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then
- If getisliving(getmyid()) Then
- commandall(606, 928)
- Do
- If getmapid() <> $forgottenshrines Then ExitLoop
- If getisdead(getmyid()) Then ExitLoop
- If $iamwonfnshrinesshrines < getherotitle() Then ExitLoop
- move(2063, -1375)
- Sleep(2000)
- Until checkarea(2063, -1375)
- EndIf
- EndIf
- EndIf
- If $iamwonfnshrinesshrines == getherotitle() AND checkarea(2063, -1375) AND getmapid() == $forgottenshrines Then
- If getisliving(getmyid()) Then
- Sleep(15000)
- moveto(606, 928)
- $startred = 1
- EndIf
- EndIf
- If $iamwonfnshrinesshrines == getherotitle() AND checkarea(606, 928) AND getmapid() == $forgottenshrines Then
- If getisliving(getmyid()) Then
- Sleep(15000)
- commandall(11, 3664)
- moveto(11, 3664)
- EndIf
- EndIf
- If $iamwonfnshrinesshrines == getherotitle() AND checkarea(11, 3664) AND getmapid() == $forgottenshrines Then
- If getisliving(getmyid()) Then
- Sleep(15000)
- commandall(-949, 946)
- moveto(-949, 946)
- Sleep(15000)
- EndIf
- EndIf
- If $iamwonfnshrinesshrines == getherotitle() AND checkarea(-949, 946) AND getmapid() == $forgottenshrines Then
- If getisliving(getmyid()) Then
- Sleep(15000)
- commandall(-2227, -1405)
- moveto(-2227, -1405)
- EndIf
- EndIf
- If $startred = 1 Then
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then Sleep(20000)
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then commandall(-949, 946)
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then Sleep(20000)
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then commandall(11, 3664)
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then Sleep(20000)
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then commandall(606, 928)
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then Sleep(20000)
- If $iamwonfnshrinesshrines == getherotitle() AND getmapid() == $forgottenshrines Then commandall(-2227, -1405)
- EndIf
- If $iamwonfnshrinesshrines < getherotitle() AND getmapid() == $forgottenshrines Then
- If getisdead(getmyid()) Then ExitLoop
- If getisliving(getmyid()) Then
- If getmapid() == $forgottenshrines Then
- out("won in FS")
- fameup()
- Sleep(5000)
- waitmaploading()
- EndIf
- EndIf
- EndIf
- EndIf
- WEnd
- GUICtrlSetData($mfnshrinesshrines, GUICtrlRead($mfnshrinesshrines) + 1)
- EndFunc
- Func goldengates()
- GUICtrlSetData($nowinmap, "Golden Gates")
- skipcinematic()
- cancelall()
- titlecheck()
- $iadengatesengates = getherotitle()
- While getmaploading() == $instanceplorablelorable AND getmapid() == $goldengates
- If getmapid() <> $goldengates Then ExitLoop
- checkisteamwiped()
- $agent = getnearestenemytoagent()
- $distance = getdistance($agent, -2)
- $besttarget = getbesttarget()
- If $iadengatesengates == getherotitle() Then
- If getnearestenemytoagent() = 0 Then
- If getisdead(getmyid()) Then ExitLoop
- If getisliving(getmyid()) Then
- If getmapid() == $goldengates Then
- out("lf enemes")
- moveto(-308, -950)
- Sleep(1000)
- EndIf
- EndIf
- EndIf
- EndIf
- If $iadengatesengates == getherotitle() Then
- If $distance > 1300 AND $distance < 5000 Then
- If getisdead(getmyid()) Then ExitLoop
- If getisliving(getmyid()) Then
- If getmapid() == $goldengates Then
- out("fight in GG")
- gonpc($agent)
- Sleep(500)
- attack($agent)
- Sleep(1500)
- EndIf
- EndIf
- EndIf
- EndIf
- If $iadengatesengates == getherotitle() Then
- If $distance < 1300 Then
- If getisdead(getmyid()) Then ExitLoop
- If getisliving(getmyid()) Then
- If getmapid() == $goldengates Then
- killenemy()
- EndIf
- EndIf
- EndIf
- EndIf
- If $iadengatesengates < getherotitle() Then
- If getisdead(getmyid()) Then ExitLoop
- If getisliving(getmyid()) Then
- If getmapid() == $goldengates Then
- out("won in GG")
- fameup()
- Sleep(5000)
- waitmaploading()
- EndIf
- EndIf
- EndIf
- WEnd
- GUICtrlSetData($mgoldengates, GUICtrlRead($mgoldengates) + 1)
- EndFunc
- Func courtyard()
- GUICtrlSetData($nowinmap, "Courtyard")
- skipcinematic()
- cancelall()
- gotonpc(getagentbyname("Ghostly Hero"))
- titlecheck()
- $iamwoncourtyard = getherotitle()
- While getmaploading() == $instanceplorablelorable AND getmapid() == $courtyard
- If getmapid() <> $courtyard Then ExitLoop
- out("Courtyard")
- checkisteamwiped()
- If $iamwoncourtyard == getherotitle() Then
- If NOT checkarea(-75, 325) Then
- If getisdead(getmyid()) Then ExitLoop
- If getisliving(getmyid()) Then
- If getmapid() == $courtyard Then
- out("lf enemes")
- Sleep(1000)
- moveto(-75, 325)
- EndIf
- EndIf
- EndIf
- EndIf
- If $iamwoncourtyard == getherotitle() Then
- If $distance < 1300 Then
- If getisdead(getmyid()) Then ExitLoop
- If getisliving(getmyid()) Then
- If getmapid() == $courtyard Then
- killenemy()
- EndIf
- EndIf
- EndIf
- EndIf
- If $iamwoncourtyard < getherotitle() Then
- If getisdead(getmyid()) Then ExitLoop
- If getisliving(getmyid()) Then
- If getmapid() == $courtyard Then
- out("won in Courtyard")
- fameup()
- Sleep(5000)
- waitmaploading()
- EndIf
- EndIf
- EndIf
- WEnd
- GUICtrlSetData($mcourtyard, GUICtrlRead($mcourtyard) + 1)
- EndFunc
- Func antechamber()
- GUICtrlSetData($nowinmap, "Antechamber")
- skipcinematic()
- cancelall()
- titlecheck()
- $iaechamberchamber = getherotitle()
- checkcolor()
- While getmaploading() == $instanceplorablelorable AND getmapid() == $antechamber
- If $iam == $iamblue Then
- out("Antechamber")
- checkisteamwiped()
- If $iaechamberchamber == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $antechamber Then
- commandall(-494, 4389)
- Do
- If getmapid() <> $antechamber Then ExitLoop
- If getisdead(getmyid()) Then ExitLoop
- If $iaechamberchamber < getherotitle() Then ExitLoop
- move(-485, 2039)
- Sleep(2000)
- Until checkarea(-485, 2039)
- EndIf
- EndIf
- EndIf
- If checkarea(-485, 2039) Then
- If $iaechamberchamber == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $antechamber Then
- Sleep(15000)
- commandall(-495, -18)
- moveto(28, 1144)
- Sleep(1000)
- EndIf
- EndIf
- EndIf
- EndIf
- If checkarea(28, 1144) Then
- If $iaechamberchamber == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $antechamber Then
- moveto(-495, -18)
- Sleep(5000)
- cancelall()
- EndIf
- EndIf
- EndIf
- EndIf
- If checkarea(-495, -18) Then
- If $iaechamberchamber == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $antechamber Then
- moveto(237, -9)
- Sleep(1000)
- EndIf
- EndIf
- EndIf
- EndIf
- If checkarea(237, -9) Then
- If $iaechamberchamber == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $antechamber Then
- moveto(-494, -2239)
- EndIf
- EndIf
- EndIf
- EndIf
- If checkarea(-494, -2239) Then
- If $iaechamberchamber == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $antechamber Then
- Sleep(15000)
- commandall(-467, -4608)
- Sleep(15000)
- cancelall()
- EndIf
- EndIf
- EndIf
- EndIf
- If $iaechamberchamber < getherotitle() Then
- If getisdead(getmyid()) Then ExitLoop
- If getisliving(getmyid()) Then
- If getmapid() == $antechamber Then
- out("won in Ante")
- Sleep(5000)
- waitmaploading()
- EndIf
- EndIf
- EndIf
- EndIf
- If $iam == $iamred Then
- out("Antechamber")
- checkisteamwiped()
- If $iaechamberchamber == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $antechamber Then
- commandall(-467, -4608)
- Do
- If getmapid() <> $antechamber Then ExitLoop
- If getisdead(getmyid()) Then ExitLoop
- If $iaechamberchamber < getherotitle() Then ExitLoop
- move(-475, -2253)
- Sleep(2000)
- Until checkarea(-494, -2239)
- EndIf
- EndIf
- EndIf
- If checkarea(-494, -2239) Then
- If $iaechamberchamber == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $antechamber Then
- Sleep(15000)
- moveto(-494, -2239)
- EndIf
- EndIf
- EndIf
- EndIf
- If checkarea(-494, -2239) Then
- If $iaechamberchamber == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $antechamber Then
- Sleep(15000)
- commandall(-495, -18)
- moveto(-1030, -1250)
- Sleep(1000)
- EndIf
- EndIf
- EndIf
- EndIf
- If checkarea(-1030, -1250) Then
- If $iaechamberchamber == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $antechamber Then
- moveto(-495, -18)
- Sleep(5000)
- cancelall()
- EndIf
- EndIf
- EndIf
- EndIf
- If checkarea(-495, -18) Then
- If $iaechamberchamber == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $antechamber Then
- moveto(237, -9)
- Sleep(1000)
- EndIf
- EndIf
- EndIf
- EndIf
- If checkarea(237, -9) Then
- If $iaechamberchamber == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $antechamber Then
- moveto(-485, 2039)
- Sleep(15000)
- EndIf
- EndIf
- EndIf
- EndIf
- If checkarea(-485, 2039) Then
- If $iaechamberchamber == getherotitle() Then
- If getisliving(getmyid()) Then
- If getmapid() == $antechamber Then
- commandall(-494, 4389)
- Sleep(15000)
- EndIf
- EndIf
- EndIf
- EndIf
- If $iaechamberchamber < getherotitle() Then
- If getisdead(getmyid()) Then ExitLoop
- If getisliving(getmyid()) Then
- If getmapid() == $antechamber Then
- out("won in Ante")
- fameup()
- Sleep(5000)
- waitmaploading()
- EndIf
- EndIf
- EndIf
- EndIf
- WEnd
- GUICtrlSetData($mantechamber, GUICtrlRead($mantechamber) + 1)
- EndFunc
- Func vault()
- GUICtrlSetData($nowinmap, "Vault")
- skipcinematic()
- If getmapid() == $vault Then
- Sleep(5000)
- out("Vault")
- travelto($ha)
- waitmaploading()
- EndIf
- EndFunc
- Func hoh()
- GUICtrlSetData($nowinmap, "Hall of Hero")
- skipcinematic()
- While getmapid() == $hoh
- If GUICtrlRead($pause) = 1 Then
- out("Bot paused")
- Sleep(2000)
- Else
- out("HoH")
- Sleep(10000)
- resign()
- waitmaploading()
- EndIf
- WEnd
- GUICtrlSetData($mhallofhero, GUICtrlRead($mhallofhero) + 1)
- EndFunc
- Func killenemy()
- If getmapid() == $uw Then
- If $distance < 1250 Then
- For $i = 1 To 7
- If getisdead(getmyid()) Then ExitLoop
- If getmaploading() == $insta_outpostoutpost Then ExitLoop
- $agent = getnearestenemytoagent()
- $besttarget = getbesttarget()
- out("Kill Enemes")
- attack($besttarget)
- calltarget($besttarget)
- Sleep(300)
- skilluserange($i, $besttarget)
- Sleep(300)
- changetarget($besttarget)
- Next
- EndIf
- EndIf
- If getmapid() <> $uw Then
- If $distance < 1250 Then
- For $i = 1 To 7
- If getisdead(getmyid()) Then ExitLoop
- If getmaploading() == $insta_outpostoutpost Then ExitLoop
- $agent = getnearestenemytoagent()
- $besttarget = getbesttarget()
- out("Kill Enemes")
- attack($agent)
- calltarget($agent)
- Sleep(300)
- skilluserange($i, $agent)
- Sleep(300)
- changetarget($agent)
- Next
- EndIf
- EndIf
- EndFunc
- Func skilluserange($skillnumber, $agent)
- $distance = getdistance($agent, -2)
- If $distance < 1250 Then
- While True
- $skillslotid = getskillbarskillid($skillnumber)
- $skillidstruct = getskillbyid($skillslotid)
- useskill($skillnumber, -1)
- $activatausgabeausgabe = DllStructGetData($skillidstruct, "Activation")
- $aftertausgabeausgabe = DllStructGetData($skillidstruct, "Aftercast")
- Sleep(1500)
- ExitLoop
- WEnd
- EndIf
- EndFunc
- Func getbesttarget($arange = 1220)
- Local $lbesttarget, $ldistance, $llowestsum = 100000000
- Local $lagentarray = getagentarray(219)
- For $i = 1 To $lagentarray[0]
- Local $lsumdistances = 0
- If DllStructGetData($lagentarray[$i], "Allegiance") <> 3 Then ContinueLoop
- If DllStructGetData($lagentarray[$i], "HP") <= 0 Then ContinueLoop
- If DllStructGetData($lagentarray[$i], "ID") = getmyid() Then ContinueLoop
- If getdistance($lagentarray[$i]) > $arange Then ContinueLoop
- For $j = 1 To $lagentarray[0]
- If DllStructGetData($lagentarray[$j], "Allegiance") <> 3 Then ContinueLoop
- If DllStructGetData($lagentarray[$j], "HP") <= 0 Then ContinueLoop
- If DllStructGetData($lagentarray[$j], "ID") = getmyid() Then ContinueLoop
- If getdistance($lagentarray[$j]) > $arange Then ContinueLoop
- $ldistance = getdistance($lagentarray[$i], $lagentarray[$j])
- $lsumdistances += $ldistance
- Next
- If $lsumdistances < $llowestsum Then
- $llowestsum = $lsumdistances
- $lbesttarget = $lagentarray[$i]
- EndIf
- Next
- Return $lbesttarget
- EndFunc
- #EndRegion
Add Comment
Please, Sign In to add comment