Official ScriptUO EasyUO Scripts > Script Snippets
TrailMyx's Item Move helper
TrailMyx:
Ok, I just whipped this up because I'm tired of moving items from one container to another. I have scripts to do this, but I'm tired of setting them up with an item type, source and destination. So this little snippet will try and understand what the source, item and destination are. Once it understands what you are trying to do, it'll ask you if it can move the rest for you. You can even move back to the source container! Great for moving MIBs around, or other items that enumerate your backpack.
Yet another little snippet that was born from the frustration of playing UO.
--- Code: easyuo ---set #LPC 300set %type N/Aset %ignore_listset %sample_contid N/Aset %first_movedgosub TM_AdvJournalSync dragrepeat if #CONTNAME = drag_gump && %sample_contid <> N/A { set %type #LLIFTEDTYPE if %type notin %ignore_list { repeat until #CONTNAME <> drag_gump set %dest_cont #CONTID if %dest_cont = N/A || %last_cont = N/A continue if %type notin %first_moved { display yesno Do you want me to move the rest of these? if #DISPRES = no { set %ignore_list %ignore_list , _ , %type continue } } wait 10 set %first_moved %first_moved , _ , %type gosub DragAll %type %last_cont %dest_cont } } set %temp_contid #CONTID if %temp_contid <> N/A { set %last_cont %sample_contid set %sample_contid %temp_contid }until #FALSE;------------------------------------------------------------------------------- sub DragAll namespace push namespace local DA set !item %1 set !source %2 set !dest %3 repeat finditem !item C_ , !source if #FINDCNT > 0 { exevent drag #FINDID #FINDSTACK wait 10 exevent dropc !dest wait 10 gosub TM_AdvJournalScan drag ADVANCE cannot if #RESULT = #TRUE break } until #FINDCNT = 0 namespace popreturn ;-------------------------------------------------------------------------------; %1 - Journal Name; %2 - #LPC setting (optional); Brings !_jindex up to the most recent #journal entrysub TM_AdvJournalSync namespace push namespace local TM_AdvJS_ , %1 set !_jindex #jindex + 1 if %0 > 1 set !lpc_set %2 namespace pop set !TM_FunctionCalled #TRUEreturn;-------------------------------------------------------------------------------; %1 - Journal Name; %2 - NONE, ADVANCE , ( _VALID ) - advances jindex pointer, anything else; %3, %4, %5, etc strings to match; returns #TRUE for match, #FALSE for no match; Will not advance !_jindex pointer to allow for scanning journal history for more than one search.; Also searches for : , #SPC in journal entry to be sure someone isn't spamming the text; About %2 arguments:; NONE: defaults to basic journal scan (no SPAM checking, no #jindex pointer copy advancing); ADVANCE: no spam checking, advances #jindex copy; VALID: invokes SPAM filtering, no advance of #jindex copy; VALID_ADVANCE, VALIDADVANCE, ADVANCE_VALID, etc.: invokes SPAM filtering, advances of #jindex copysub TM_AdvJournalScan namespace push namespace local TM_AdvJS_ , %1 set !args %2 set !temp_lpc #LPC if !lpc_set = N/A set #LPC 1000 else set #LPC !lpc_set set !num_args %0 set !first_arg 3 set !sampled_jindex #JINDEX if !_jindex = N/A set !_jindex !sampled_jindex if !charname = N/A { set !charname #CHARNAME AdvJournalScan_loop1: str pos !charname #SPC if #STRRES <> 0 { set !val #STRRES - 1 str left !charname !val set !left #STRRES set !val !val + 1 str del !charname 1 !val set !charname !left , _ , #STRRES goto AdvJournalScan_loop1 } } set !index !first_arg repeat set !temp_jindex !_jindex set !text % . !index while !temp_jindex <= !sampled_jindex { scanjournal !temp_jindex str pos #JOURNAL !charname 1 set !namepos #STRRES str count #JOURNAL !charname set !namecnt #STRRES str pos #JOURNAL :_ 1 set !smcpos #STRRES str pos #JOURNAL !text 1 set !textpos #STRRES if !textpos < !smcpos && !smcpos <> 0 || !smcpos = 1 || :_ notin #JOURNAL || VALID notin !args set !pass #TRUE else set !pass #FALSE if ( !text in #journal && ( ( !namepos = 1 && !namecnt <= 1 ) || !pass ) ) { set !temp_jindex !temp_jindex + 1 if ADVANCE in !args set !_jindex !temp_jindex set #LPC !temp_lpc namespace pop set !TM_FunctionCalled #TRUE return #TRUE } set !temp_jindex !temp_jindex + 1 } set !index !index + 1 until !index - !first_arg > !num_args - !first_arg set %10 !sampled_jindex - !_jindex set %10 %1 , _ , %10 ; for debugging purposes set #LPC !temp_lpc namespace pop set !TM_FunctionCalled #TRUEreturn #FALSE
You can help the script a little bit by quickly clicking on the source container before you drag the first item. Most of the time it'll still sense what you are trying to do, but this will guarantee it to move the rest of the items for you.
aibandit:
Thank you so much for this!
TrailMyx:
I still use this little snippet a whole bunch.. i.e. moving MIBs, like items, etc. I modified it to work a little better.
seeriusly:
I use this a bunch! Thanks TM... Saves a whole hell of a lot of clicks!
TrailMyx:
--- Quote from: seeriusly on January 15, 2012, 09:58:40 AM ---I use this a bunch! Thanks TM... Saves a whole hell of a lot of clicks!
--- End quote ---
Yah, it's one of those silly little scripts that can save so much time. I use it alot when I'm moving my MIBs/SOSes from container to container. I wanted something that would just "automatically" determine what you are trying to do.
Navigation
[0] Message Index
[#] Next page
Go to full version