/drawstar

By QuickStep on Apr 25, 2006

This is the commented section from below

;
; Drawstar, Created by QuickStep
; Draws a star to a picture window
;
; Format:
;  /drawstar -ihnr @ &#60color&#62 &#60size&#62 &#60x y&#62 &#60inner radius&#62 &#60outer radius&#62 &#60points&#62
;
; Examples: 
; 
; /drawstar @ 1 1 100 100 20 80 5
; Draws a 5 point black star at (100,100) with an inner radius of 20 and an outer radius of 80
;
; /drawstar @ 7 1 100 100 80 85 60
; Draws an orange sun at (100,100)
;
; This alias can be quite usefull, and with some experimentation (loops)
; it is possible to create some beautifull looking figures.
;
;
; Drawstar, Created by QuickStep
; Draws a star to a picture window
;
; Format:
;  /drawstar -ihnr @ <color> <size> <x y> <inner radius> <outer radius> <points>
;
; Examples: 
; 
; /drawstar @ 1 1 100 100 20 80 5
; Draws a 5 point black star at (100,100) with an inner radius of 20 and an outer radius of 80
;
; /drawstar @ 7 1 100 100 80 85 60
; Draws an orange sun at (100,100)
;
; This alias can be quite usefull, and with some experimentation (loops)
; it is possible to create some beautifull looking figures.
;
;
; Drawstar, Created by QuickStep
; Draws a star to a picture window
;
; Format:
;  /drawstar -ihnr @ <color> <size> <x y> <inner radius> <outer radius> <points>
;
; Examples: 
; 
; /drawstar @ 1 1 100 100 20 80 5
; Draws a 5 point black star at (100,100) with an inner radius of 20 and an outer radius of 80
;
; /drawstar @ 7 1 100 100 80 85 60
; Draws an orange sun at (100,100)
;
; This alias can be quite usefull, and with some experimentation (loops)
; it is possible to create some beautifull looking figures.
;

alias drawstar {

  ; Check if first parameter is a switch
  var %switch
  if (-* iswm $1) {
    %switch = $1
    tokenize 32 $2-
  }

  ; Basic error checking, the label will catch the rest
  if (!$8) drawstar_error insufficient parameters
  if (($8 !isnum) || ($8 < 2)) drawstar_error invalid points

  ; Main Code
  var %step = $calc($pi / $8), %rad = 0, %p = $calc($8 * 2), %prev, %next = $4 $calc($5 - $7)
  while (%p) {
    inc %rad %step | dec %p
    %prev = %next
    %next = $calc($4 + ($sin(%rad) * $iif($calc(%p % 2),$6,$7))) $calc($5 - ($cos(%rad) * $iif($calc(%p % 2),$6,$7)))
    drawline %switch $1-3 %prev %next
  }
  return

  ; Error Handling
  :error | drawstar_error $error
}

; Error output
alias -l drawstar_error {
  echo $color(info) -eq * /drawstar: $iif($1 = *,$3-,$1-)
  halt
}

Comments

Sign in to comment.
Korvin   -  Oct 07, 2007

i put 50090 points. im lagging atm xD

More
 Respond  
StanZ   -  Sep 18, 2006

Yep, nice one! ///window -CpdoBf @a 0 0 320 200 | drawstar -r @a $rgb(250,250,0) 1 160 100 20 80 16 (no invalid window then)

loele: free slave work and no screens for me!! </3

More
 Respond  
Jordyboy   -  May 14, 2006

Its, ok, it doesn\'t seem to work on mIRC 6.17 or does it, is it added into remotes or not?

Good, Work =)

More
 Respond  
Jared   -  May 13, 2006

loele? LOLELE! Nice to see ya here.

More
 Respond  
loele   -  May 12, 2006

jeje cool the sun it\'s like a really old code that i made for a friend x\'D

http://www.geocities.com/loele_rules/Events.txt

More
 Respond  
xDaeMoN   -  May 02, 2006

@Sasuke & spitfire3292, you need to make a PICTURE WINDOW for this script to work properly. It\'s already stated in the author\'s notes & on the comments section.

To create a picture window: /window -p @test Use a sample provided: /drawstar @test 1 1 100 100 20 80 5

More
 Respond  
spitfire3292   -  May 02, 2006

Sasuke

  • /drawstar: invalid window (line 57, script6.txt)

    ... Humph. I thought you were PERFECT! Shows me! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Ditto

More
 Respond  
Hawkee   -  Apr 27, 2006

Quick, maybe you can tag this with \"picwin\". I noticed a few other scripters are using that tag and it\'s very appropriate for this snippet.

More
 Respond  
Pibb   -  Apr 26, 2006

you double posted the info in the code part.

More
 Respond  
QuickStep   -  Apr 26, 2006

it\'s for picture windows...

More
 Respond  
Zybez   -  Apr 26, 2006

Invalid Window???

More
 Respond  
LIQUID_NiTrO   -  Apr 25, 2006

Nice work.

More
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.