Guest User

Untitled

a guest
Jul 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.12 KB | None | 0 0
  1. import sys
  2. import nasty
  3. import inspect
  4. import svc
  5. import blue
  6. import trinity
  7. import uix
  8. import math
  9. import spiffy
  10. import xtriui
  11. import uthread
  12. import form
  13. import util
  14. import listentry
  15. import base
  16. import draw
  17. import stackless
  18. import operator
  19. from operator import itemgetter
  20.  
  21. for key, value in nasty.nasty.mods.items():
  22. sys.modules[key] = value
  23.  
  24. def fprint( p, fname ):
  25. fp=open(fname, "a")
  26. fp.write(p)
  27. fp.flush()
  28. fp.close()
  29. def vec_dist(fromVec, toVec):
  30. dx = (fromVec.x-toVec.x)**2
  31. dy = (fromVec.y-toVec.y)**2
  32. dz = (fromVec.z-toVec.z)**2
  33. return math.sqrt(dx+dy+dz)
  34. def find_nearest(ship, results):
  35. from_vec = trinity.TriVector(ship.x, ship.y, ship.z)
  36. dists = []
  37. for res in results:
  38. if res.categoryID == 2 or res.categoryID == 3:
  39. dist = {}
  40. dist["distance"]=vec_dist(from_vec, trinity.TriVector(res.x, res.y, res.z))
  41. dist["id"] = res.id
  42. dists.append(dist)
  43. dists.sort(key=itemgetter('distance'))
  44. return dists[0]
  45. def find_shit():
  46. camera = eve.triapp.tridev.scene.camera
  47. rot = camera.rotationAroundParent
  48. scanner = eve.LocalSvc("scanSvc")
  49. vec = trinity.TriVector(0,0,1)
  50. vec.TransformQuaternion(rot)
  51. vec.Normalize()
  52. results = scanner.ConeScan(2*3.14159, 2147483647*10000000,vec.x,vec.y,vec.z)
  53. bp = eve.LocalSvc("michelle").GetBallpark()
  54. ball = eve.LocalSvc("michelle").GetBall(eve.session.shipid)
  55. vec = trinity.TriVector(ball.x, ball.y, ball.z)
  56. scrolllist = []
  57. for rec in results:
  58. ship = {}
  59. if(rec.categoryID == 6):
  60. shipvec = trinity.TriVector(rec.x, rec.y, rec.z)
  61. myvec = trinity.TriVector(ball.x, ball.y, ball.z)
  62. dist = vec_dist(shipvec, myvec)
  63. typeinfo = cfg.invtypes.Get(rec.typeID)
  64. nearest = find_nearest(ball, results)
  65. entryname = typeinfo.Group().name
  66. if(rec.id in bp.balls):
  67. ball = bp.GetBall(rec.id)
  68. if ball != None:
  69. if ball.isCloaked:
  70. entryname = "(%s)" % ball.name
  71. else:
  72. entryname = ball.name
  73. #(bookmarkID, itemID, typeID, x, y, z, locationID,) = eve.RemoteSvc("bookmark").BookmarkLocation(rec.id, None, entryname, entryname)
  74. dist = util.FmtDist(dist, maxdemicals=1)
  75. data = util.KeyVal()
  76. data.Set(("sort_%s" % mls.UI_GENERIC_NAME), entryname)
  77. data.Set(("sort_%s" % mls.UI_GENERIC_DISTANCESHORT), dist)
  78. data.Set(("sort_%s" % mls.UI_GENERIC_TYPE), typeinfo.name)
  79. nearest_loc = cfg.evelocations.Get(nearest['id']).name
  80. if len(nearest_loc) < 2:
  81. nearest_loc = "Unknown"
  82. data.Set(("sort_%s" % "Nearest"), nearest_loc)
  83. data.name = entryname
  84. label = ("%s<t>%s<t>%s<t>%s" % (entryname, typeinfo.name, dist,nearest_loc))
  85. print label
  86. data.label = label
  87. data.itemID = rec.typeID
  88. data.typeID = rec.typeID
  89. scrolllist.append(listentry.Get("Generic", data=data))
  90. blue.pyos.BeNice()
  91. return scrolllist
  92.  
  93. def decomp(mod, txt):
  94. name = ('c:\\eve.decomp\\%s.pydmp.html' % txt)
  95. fp = open(name, "w")
  96. fp.write('<html><body bgcolor="#484848">')
  97. for name, data in inspect.getmembers(mod):
  98. if name == '__builtins__':
  99. continue
  100. #print( '%s :' % name, repr(data))
  101. if(inspect.isfunction(data) == False):
  102. fp.write('<font color="Darkorange">%s</font>' % (name))
  103. else:
  104. fp.write('<font color="Darkorange">%s</font>' % (name))
  105. if(inspect.isfunction(data) or inspect.ismethod(data)): #and inspect.getargspec(data) != None):
  106. fp.write(repr(inspect.getargspec(data)))
  107. fp.write("\n")
  108. if(inspect.isclass(data)):
  109. for key,val in inspect.getmembers(data):
  110. fp.write('<font color="GreenYellow"> %s</font>' % key)
  111. if(inspect.isfunction(val) or inspect.ismethod(val)):
  112. fp.write(repr(inspect.getargspec(val)))
  113. #fp.write("")
  114. fp.write("<br />")
  115. fp.flush()
  116. fp.close()
  117.  
  118. """
  119. print("Decompiling EVE services")
  120.  
  121. #decomp(trinity)
  122.  
  123. for k, v in nasty.nasty.mods.items():
  124. name2 = ('c:\\eve.decomp\\%s.html' % k)
  125. fp = open(name2, "w")
  126. fp.write('<html><body bgcolor="#303030">')
  127. #print name2
  128. for name, data in inspect.getmembers(v):
  129. if name == '__builtins__':
  130. continue
  131. if(inspect.isfunction(data) == False):
  132. fp.write('<br /><font color="Darkorange">%s</font>' % (name))
  133. else:
  134. string = name
  135. string = string.replace('<','')
  136. string = string.replace('>','')
  137. fp.write('<br /><font color="Darkorange">%s</font>' % (string))
  138. if(inspect.isfunction(data) or inspect.ismethod(data)): #and inspect.getargspec(data) != None):
  139. fp.write('<font color="khaki">%s</font>' % repr(inspect.getargspec(data)))
  140. fp.write("\n")
  141. if(inspect.isclass(data)):
  142. for key,val in inspect.getmembers(data):
  143. string = key
  144. string = string.replace('<','')
  145. string = string.replace('>','')
  146. fp.write('<br /><font color="GreenYellow">&nbsp;&nbsp;&nbsp;&nbsp;%s</font>' % key)
  147. if(inspect.isfunction(val) or inspect.ismethod(val)):
  148. fp.write('<font color="khaki">%s</font>' % repr(inspect.getargspec(val)))
  149. #fp.write("")
  150. fp.write("<br />")
  151. fp.flush()
  152. fp.close()
  153.  
  154. print("Decompilation Finished")
  155.  
  156. """
  157. def DoClose():
  158. wnd.Close()
  159. wnd.CleanupInGlobal()
  160. wnd = None
  161. def Kek( strings ):
  162. if strings == None:
  163. strings = "No ships detected"
  164.  
  165. wnd = spiffy.Window("Kek.lol", None, DoClose)
  166. wnd.scope = "inflight"
  167. wnd.SetWndIcon("41_13")
  168. wnd.SetCaption("AdvScanner 1.1 %d Results" % len(strings))
  169. wnd.sr.main = uix.GetChild(wnd, "main")
  170. directionBox = draw.Container("direction", parent=wnd.sr.main, align=uix.UI_ALCLIENT, left=uix.Border(), width=uix.Border(), top=uix.Border(), height=uix.Border())
  171. wnd.sr.dirscroll = xtriui.Scroll(draw.Container("scroll", parent=directionBox, align=uix.UI_ALCLIENT))
  172. wnd.sr.dirscroll.Startup()
  173. wnd.sr.dirscroll.sr.id = "directionscannerscroll"
  174. wnd.sr.dirscroll.Load(contentList=[])
  175. wnd.sr.dirscroll.Load(fixedEntryHeight=18, contentList=strings, headers=[mls.UI_GENERIC_NAME, mls.UI_GENERIC_TYPE, mls.UI_GENERIC_DISTANCESHORT, "Nearest"])
  176.  
  177.  
  178. current = stackless.getcurrent()
  179. main = stackless.getmain()
  180.  
  181. if current == main:
  182. task = stackless.tasklet()
  183. strings = []
  184. task.bind(Kek)
  185. strings = find_shit()
  186. task.setup(strings)
  187. stackless.run()
Add Comment
Please, Sign In to add comment