Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data={}
- system.bindMouse("Eliaseeg",true)
- data["Eliaseeg"]={
- primerCheck=nil
- };
- id=1
- color="0x2E9AFE"
- drawMode=circle
- function eventMouse(name,xCursor,yCursor)
- if(not data[name].primerCheck)then
- data[name].primerCheck={x=xCursor,y=yCursor}
- else
- drawMode(data[name].primerCheck,{x=xCursor,y=yCursor},1)
- data[name].primerCheck = nil
- end
- end
- function line(punto1,punto2,res)
- a=(punto1.y-punto2.y)/(punto1.x-punto2.x)
- b=punto1.y-a*punto1.x
- if(punto1.x>punto2.x) then punto1,punto2=punto2,punto1 end
- for i=punto1.x,punto2.x,res do
- ui.addTextArea(id,"",nil,i,a*i+b, 1, 1, color, color)
- id=id+1
- end
- end
- function circle(point1,point2)
- r=math.sqrt(math.pow((point1.x-point2.x),2)+math.pow((point1.y-point2.y),2))
- res=1-r*math.pow(10,-2)
- if(res<0.1)then res =0.1 end
- for i=0,2*math.pi,res do
- ui.addTextArea(id,"",nil,point1.x+r*math.cos(i),point1.y+r*math.sin(i), 1, 1, color, color)
- id=id+1
- end
- end
- function eventChatCommand(name,command)
- local args={}
- for argument in command:gmatch("[^%s]+") do
- table.insert(args, argument)
- end
- if args[1]=="clear" then
- for i=1,id do
- ui.removeTextArea(i)
- end
- elseif args[1]=="color" then
- color="0x"..args[2]
- elseif args[1]=="linea" then
- drawMode=line
- elseif args[1]=="circulo" then
- drawMode=circle
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement