Imagine Nation Forums

Full Version: [Injection] Cotton/Flax to cloth
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Will try to use all spinning wheels it can reach and one loom. No need to set anything, just make sure loom\spinning wheel(s) are reachable.

Code:
sub cftocloth()
    DIM rs[7]
    rs[0]=  '0x1A9D'  
    rs[1] = '0x1A9C'      
    rs[2] = '0x1A9A'
    rs[3] = '0x0DF9'
    rs[4] = '0x0FA0'
    rs[5] = '0x105F'
    rs[6] = '0x1062'
    var loom,wheel,i,cf,z,cycles
    UO.Print('CF to Cloth running')
    UO.Set('finddistance','6')
    For z = 5 to 6
        UO.FindType(rs[z],-1,'ground')
        if UO.FindCount()>0 then
            loom=UO.GetSerial('finditem')
        endif
    next
    For i = 0 to 3
        repeat
            UO.IgnoreReset()
            wait(500)
            UO.FindType(rs[i],-1,'my')
            If UO.FindCount('finditem')>0 then
                repeat
                    UO.FindType('0x1015',-1,'ground')
                    wheel=UO.GetSerial('finditem')
                    UO.WaitTargetObject(wheel)
                    UO.UseType(rs[i])
                    wait(200)  
                    UO.Ignore(wheel)
                    wait(200)
                Until NOT UO.FindCount('0x1015')>0 OR NOT UO.Count(rs[i])>0
            endif
        Until NOT UO.Count(rs[i])>0  
    next
    repeat
        UO.FindType(rs[4],-1,'my')
        If UO.FindCount()>0 then
            UO.DeleteJournal()
            cycles=0
            uo.waittargetobject(loom)
            uo.useobject('finditem')          
            repeat
                cycles = cycles + 1
                wait(10)  
            until UO.InJournal('The bolt|You create') OR (cycles>500)
        endif
    until NOT UO.FindCount(rs[4])>0
    UO.Print('Script finished.')
endsub