Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import nasty
- import inspect
- import svc
- import blue
- import trinity
- import uix
- import math
- import spiffy
- import xtriui
- import uthread
- import form
- import util
- import listentry
- import base
- import draw
- import stackless
- import operator
- from operator import itemgetter
- for key, value in nasty.nasty.mods.items():
- sys.modules[key] = value
- def fprint( p, fname ):
- fp=open(fname, "a")
- fp.write(p)
- fp.flush()
- fp.close()
- def vec_dist(fromVec, toVec):
- dx = (fromVec.x-toVec.x)**2
- dy = (fromVec.y-toVec.y)**2
- dz = (fromVec.z-toVec.z)**2
- return math.sqrt(dx+dy+dz)
- def find_nearest(ship, results):
- from_vec = trinity.TriVector(ship.x, ship.y, ship.z)
- dists = []
- for res in results:
- if res.categoryID == 2 or res.categoryID == 3:
- dist = {}
- dist["distance"]=vec_dist(from_vec, trinity.TriVector(res.x, res.y, res.z))
- dist["id"] = res.id
- dists.append(dist)
- dists.sort(key=itemgetter('distance'))
- return dists[0]
- def find_shit():
- camera = eve.triapp.tridev.scene.camera
- rot = camera.rotationAroundParent
- scanner = eve.LocalSvc("scanSvc")
- vec = trinity.TriVector(0,0,1)
- vec.TransformQuaternion(rot)
- vec.Normalize()
- results = scanner.ConeScan(2*3.14159, 2147483647*10000000,vec.x,vec.y,vec.z)
- bp = eve.LocalSvc("michelle").GetBallpark()
- ball = eve.LocalSvc("michelle").GetBall(eve.session.shipid)
- vec = trinity.TriVector(ball.x, ball.y, ball.z)
- scrolllist = []
- for rec in results:
- ship = {}
- if(rec.categoryID == 6):
- shipvec = trinity.TriVector(rec.x, rec.y, rec.z)
- myvec = trinity.TriVector(ball.x, ball.y, ball.z)
- dist = vec_dist(shipvec, myvec)
- typeinfo = cfg.invtypes.Get(rec.typeID)
- nearest = find_nearest(ball, results)
- entryname = typeinfo.Group().name
- if(rec.id in bp.balls):
- ball = bp.GetBall(rec.id)
- if ball != None:
- if ball.isCloaked:
- entryname = "(%s)" % ball.name
- else:
- entryname = ball.name
- #(bookmarkID, itemID, typeID, x, y, z, locationID,) = eve.RemoteSvc("bookmark").BookmarkLocation(rec.id, None, entryname, entryname)
- dist = util.FmtDist(dist, maxdemicals=1)
- data = util.KeyVal()
- data.Set(("sort_%s" % mls.UI_GENERIC_NAME), entryname)
- data.Set(("sort_%s" % mls.UI_GENERIC_DISTANCESHORT), dist)
- data.Set(("sort_%s" % mls.UI_GENERIC_TYPE), typeinfo.name)
- nearest_loc = cfg.evelocations.Get(nearest['id']).name
- if len(nearest_loc) < 2:
- nearest_loc = "Unknown"
- data.Set(("sort_%s" % "Nearest"), nearest_loc)
- data.name = entryname
- label = ("%s<t>%s<t>%s<t>%s" % (entryname, typeinfo.name, dist,nearest_loc))
- print label
- data.label = label
- data.itemID = rec.typeID
- data.typeID = rec.typeID
- scrolllist.append(listentry.Get("Generic", data=data))
- blue.pyos.BeNice()
- return scrolllist
- def decomp(mod, txt):
- name = ('c:\\eve.decomp\\%s.pydmp.html' % txt)
- fp = open(name, "w")
- fp.write('<html><body bgcolor="#484848">')
- for name, data in inspect.getmembers(mod):
- if name == '__builtins__':
- continue
- #print( '%s :' % name, repr(data))
- if(inspect.isfunction(data) == False):
- fp.write('<font color="Darkorange">%s</font>' % (name))
- else:
- fp.write('<font color="Darkorange">%s</font>' % (name))
- if(inspect.isfunction(data) or inspect.ismethod(data)): #and inspect.getargspec(data) != None):
- fp.write(repr(inspect.getargspec(data)))
- fp.write("\n")
- if(inspect.isclass(data)):
- for key,val in inspect.getmembers(data):
- fp.write('<font color="GreenYellow"> %s</font>' % key)
- if(inspect.isfunction(val) or inspect.ismethod(val)):
- fp.write(repr(inspect.getargspec(val)))
- #fp.write("")
- fp.write("<br />")
- fp.flush()
- fp.close()
- """
- print("Decompiling EVE services")
- #decomp(trinity)
- for k, v in nasty.nasty.mods.items():
- name2 = ('c:\\eve.decomp\\%s.html' % k)
- fp = open(name2, "w")
- fp.write('<html><body bgcolor="#303030">')
- #print name2
- for name, data in inspect.getmembers(v):
- if name == '__builtins__':
- continue
- if(inspect.isfunction(data) == False):
- fp.write('<br /><font color="Darkorange">%s</font>' % (name))
- else:
- string = name
- string = string.replace('<','')
- string = string.replace('>','')
- fp.write('<br /><font color="Darkorange">%s</font>' % (string))
- if(inspect.isfunction(data) or inspect.ismethod(data)): #and inspect.getargspec(data) != None):
- fp.write('<font color="khaki">%s</font>' % repr(inspect.getargspec(data)))
- fp.write("\n")
- if(inspect.isclass(data)):
- for key,val in inspect.getmembers(data):
- string = key
- string = string.replace('<','')
- string = string.replace('>','')
- fp.write('<br /><font color="GreenYellow"> %s</font>' % key)
- if(inspect.isfunction(val) or inspect.ismethod(val)):
- fp.write('<font color="khaki">%s</font>' % repr(inspect.getargspec(val)))
- #fp.write("")
- fp.write("<br />")
- fp.flush()
- fp.close()
- print("Decompilation Finished")
- """
- def DoClose():
- wnd.Close()
- wnd.CleanupInGlobal()
- wnd = None
- def Kek( strings ):
- if strings == None:
- strings = "No ships detected"
- wnd = spiffy.Window("Kek.lol", None, DoClose)
- wnd.scope = "inflight"
- wnd.SetWndIcon("41_13")
- wnd.SetCaption("AdvScanner 1.1 %d Results" % len(strings))
- wnd.sr.main = uix.GetChild(wnd, "main")
- directionBox = draw.Container("direction", parent=wnd.sr.main, align=uix.UI_ALCLIENT, left=uix.Border(), width=uix.Border(), top=uix.Border(), height=uix.Border())
- wnd.sr.dirscroll = xtriui.Scroll(draw.Container("scroll", parent=directionBox, align=uix.UI_ALCLIENT))
- wnd.sr.dirscroll.Startup()
- wnd.sr.dirscroll.sr.id = "directionscannerscroll"
- wnd.sr.dirscroll.Load(contentList=[])
- wnd.sr.dirscroll.Load(fixedEntryHeight=18, contentList=strings, headers=[mls.UI_GENERIC_NAME, mls.UI_GENERIC_TYPE, mls.UI_GENERIC_DISTANCESHORT, "Nearest"])
- current = stackless.getcurrent()
- main = stackless.getmain()
- if current == main:
- task = stackless.tasklet()
- strings = []
- task.bind(Kek)
- strings = find_shit()
- task.setup(strings)
- stackless.run()
Add Comment
Please, Sign In to add comment