Author | Post |
CyBex  | 12-05-2005, 19:36 | [Site] Paste site | Jabber ICQ AOL IM Yahoo IM MSN Homepage |
nie da (Administrator)

Member since 01/2004 260 Posts Location: Berlin
| The paste site has now colors for syntax highlight..
Its now easier to find quote errors and wrong command..
Have fun and good luck ...
mfG CyBex @ QuakeNet, UnderNet, EFNet, Freenode, euIRC, GameSurge & ShadowWorld - Files |
This post was edited 1 times, last on 08-09-2006, 01:55 by CyBex
|
 |
elven  | 12-06-2005, 03:47  | Jabber |
security dept. (Administrator) Member since 03/2004 55 Posts
| Looks good, thanks.
|
 |
CyBex  | 02-12-2006, 16:13  | Jabber ICQ AOL IM Yahoo IM MSN Homepage |
nie da (Administrator)

Member since 01/2004 260 Posts Location: Berlin
| Much more colors and helpful procs included..
The paste site counts now every brace/bracket and return a message if open/close are unbalanced.
And every brace/bracket get now a little bit color, depend on the deep.
And the announcer works again, when the bot found your nick or your auth in the channel, your paste will get announced.
I hope it helps much more.. 
mfG CyBex @ QuakeNet, UnderNet, EFNet, Freenode, euIRC, GameSurge & ShadowWorld - Files |
 |
CyBex  | 08-09-2006, 01:57  | Jabber ICQ AOL IM Yahoo IM MSN Homepage |
nie da (Administrator)

Member since 01/2004 260 Posts Location: Berlin
| new improves to the paste site:
- syntax highlight for sbnc
- syntax check for standard tcl, eggdrop and sbnc scripts (thanx 2 thommey)
to disable check, switch (Text)Type from "TCL" > "Text"
mfG CyBex @ QuakeNet, UnderNet, EFNet, Freenode, euIRC, GameSurge & ShadowWorld - Files |
 |
CyBex  | 07-23-2008, 00:41  | Jabber ICQ AOL IM Yahoo IM MSN Homepage |
nie da (Administrator)

Member since 01/2004 260 Posts Location: Berlin
| New improvements:
- listen port for raw data, now it is easy to paste code from your shell, if a raw tcp/ip client is installed (netcat, telnet, ...)
examples:
cat scripts/file.tcl | netcat -q 2 tclhelp.net 55555
tail -n 10 logs/eggdrop.log | nc -q 2 tclhelp.net 55555
(cat scripts/file.tcl && sleep 2) | telnet tclhelp.net 55555
(tail -n 10 scripts/file.tcl && sleep 2) | telnet tclhelp.net 55555
mfG CyBex @ QuakeNet, UnderNet, EFNet, Freenode, euIRC, GameSurge & ShadowWorld - Files |
This post was edited 5 times, last on 07-23-2008, 02:32 by thommey
|
 |
Gotisch  | 08-03-2008, 00:31  | ICQ |
(Moderator) Member since 01/2006 19 Posts Location: Europe
| does it return the url of the paste?  |
 |
never-so-not-logged-in | 03-22-2009, 14:21 | enhancement: better tab-order | |
(Guest)
| Order for switching through elements bei pressing the TAB-Key can be improved:
- required fields first
- then a button to add it
or:
- fields ordered by screen display order  |
 |
never-still-too-lazy-to-log-in | 05-04-2009, 10:46  | |
(Guest)
| - redirect users after adding paste to pasteurl so they can copy it from browser address bar  |
 |
hm2k  | 10-27-2009, 00:28  | |
Member since 10/2009 4 Posts
| What options are used with nagelfar?  |
 |
thommey  | 10-27-2009, 00:33  | Jabber |
(Administrator) Member since 03/2004 62 Posts
| Nothing special.
1
|
nagelfar.tcl -quiet -html -Welse0 -prefix l <file to test>
|
Where -html and -prefix are modifications to nagelfar so it generates html output suitable for integration into the pastesite (non-standard options).  |
This post was edited 1 times, last on 10-27-2009, 00:34 by thommey
|
 |
hm2k  | 10-27-2009, 11:01  | |
Member since 10/2009 4 Posts
| Is any stripping done to ignore errors such as:
Line N: E Wrong number of arguments (4) to "bind"
Since the bind command with tcl is different to the one in eggdrop.  |
 |
thommey  | 10-27-2009, 13:41  | Jabber |
(Administrator) Member since 03/2004 62 Posts
| I modified nagelfar to check for eggdrop's bind instead of Tk's bind.
(No one pastes Tk, ever, afaik  .
The full patch I applied to nagelfar is:
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031
032
033
034
035
036
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
061
062
063
064
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
093
094
095
096
097
098
099
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
|
--- nagelfar.tcl 2009-07-19 19:18:25.421025665 +0200
+++ nagelfar.tcl 2009-10-27 13:36:48.181154390 +0100
@@ -24,10 +24,10 @@
# $Revision: 424 $
#----------------------------------------------------------------------
# the next line restarts using tclsh \
-exec tclsh "$0" "$@"
+exec tclsh8.5 "$0" "$@"
set debug 0
-package require Tcl 8.4
+package require Tcl 8.5
package provide app-nagelfar 1.0
set version "Version 1.1.9 2008-09-05"
@@ -132,9 +132,19 @@
}
}
+proc Text2Html {data} {
+ string map {\& \& \< \< \> \> \" \"} $data
+}
+
# Standard error message.
# severity : How severe a message is E/W/N for Error/Warning/Note
proc errorMsg {severity msg i} {
+ if {$::Prefs(html)} {
+ set msg [Text2Html $msg]
+ if {$msg == "Expr without braces"} { append msg " (see <a href=\"http://tclhelp.net/unb/194\" target=\"_tclforum\">http://tclhelp.net/unb/194</a>)" }
+ }
+ if {[string match debug* $msg]} { return 0 }
+
if {[info exists ::Nagelfar(currentMessage)] && \
$::Nagelfar(currentMessage) != ""} {
lappend ::Nagelfar(messages) [list $::Nagelfar(currentMessageLine) \
@@ -157,7 +167,15 @@
set pre "$::currentFile: "
}
set line [calcLineNo $i]
+
+ switch -exact -- $severity {
+ E { set color "#DD0000"; set severity "ERROR" }
+ W { set color "#FFAA00"; set severity "WARNING" }
+ N { set color "#66BB00"; set severity "NOTICE" }
+ }
set pre "${pre}Line [format %3d $line]: $severity "
+ if {$::Prefs(html)} { set pre "<a href=#$::Prefs(prefix)$line>Line [format %3d $line]</a>: <font color=$color><strong>$severity</strong></font>: " }
+
set ::Nagelfar(indent) [string repeat " " [string length $pre]]
set ::Nagelfar(currentMessage) $pre$msg
set ::Nagelfar(currentMessageLine) $line
@@ -180,6 +198,27 @@
set ::Nagelfar(commentbrace) {}
}
+proc sortmsgs {msg1 msg2} {
+ if {$msg1 == $msg2} { return 0 }
+ set htmlmask "href=#$::Prefs(prefix)(\\d+)>"
+ set normmask "Line\\s+(\\d+):"
+ if {![info exists ::sortRE]} {
+ if {$::Prefs(html)} { set ::sortRE $htmlmask } else { set ::sortRE $normmask }
+ # cache
+ regexp -- $::sortRE ""
+ }
+ regexp -- $::sortRE $msg1 -> line1
+#puts "Matching '$re' against '$msg1' -> [info exists line1]"
+ regexp -- $::sortRE $msg2 -> line2
+#puts "Matching '$re' against '$msg2' -> [info exists line2]"
+ if {![info exists line1] || ![info exists line2]} {
+ puts stderr "Could not sort messages! Wrong format! (html: $::Prefs(html))"; return -1
+ }
+ if {$line1 > $line2} { return 1 } else { return -1 }
+ return 0
+}
+
+
# Called after a file has been parsed, to flush messages
proc flushMsg {} {
if {[info exists ::Nagelfar(currentMessage)] && \
@@ -187,7 +226,8 @@
lappend ::Nagelfar(messages) [list $::Nagelfar(currentMessageLine) \
$::Nagelfar(currentMessage)]
}
- set msgs [lsort -integer -index 0 $::Nagelfar(messages)]
+# set msgs [lsort -integer -index 0 $::Nagelfar(messages)]
+ set msgs [lsort -unique -increasing -command sortmsgs $::Nagelfar(messages)]
foreach msg $msgs {
set text [lindex $msg 1]
set print 1
@@ -385,6 +425,7 @@
if {$i == -1} {
# This should never happen since no incomplete lines should
# reach this function.
+# puts "Unable to parse this line. Missing ' ' before '\{' perhaps? (Line [expr {$index + $i}])"
decho "Internal error: Did not find close char in scanWord.\
Line [calcLineNo $index]."
return $len
@@ -1591,6 +1632,7 @@
# If the command contains substitutions we can not determine
# which command it is, so we skip it, unless the type is known
# to be an object.
+
if {($cmdws & 1) == 0} {
if {[string match "_obj,*" $cmdtype]} {
set cmd $cmdtype
@@ -1630,6 +1672,7 @@
# have their own special check implemented here.
# Any command that can be checked by checkCommand should
# be in the syntax database.
+
switch -glob -- $cmd {
proc {
if {$argc != 3} {
@@ -1651,11 +1694,22 @@
parseProc $argv $indices
set noConstantCheck 1
}
- .* { # FIXA, check code in any -command.
- # Even widget commands should be checked.
- # Maybe in checkOptions ?
- return
- }
+ bind { # eggdrop bind!
+ if {$argc != 3 && $argc != 4} { WA; return }
+ foreach {type flags keyw cmd} $argv { break }
+ switch -exact -- [string tolower $type] {
+ load - unld - evnt - disc { set argnum 1 }
+ link - nkch - filt - need - wall - chon - choff { set argnum 2 }
+ sent - rcvd - note - act - bcst - chat - raw - bot - fil - away - dcc { set argnum 3 }
+ msg - msgm - splt - rejn - chpt - join { set argnum 4 }
+ flud - time - nick - notc - sign - topc - lost - tout - pub - pubm - part { set argnum 5 }
+ mode - ctcp - ctcr - chjn - kick { set argnum 6 }
+ default { errorMsg W "Unknown bind type: $type" $index; return }
+ }
+ set appendstr [string repeat " bla" $argnum]
+ append cmd $appendstr
+ parseBody $cmd [lindex $indices 3] knownVars
+ }
global {
foreach var $argv ws $wordstatus {
if {$ws & 1} {
@@ -2348,9 +2402,9 @@
if {$tmp != $closeBrace} {
# Only do this if there is a free open brace
if {[regexp "\{\n" $tryline]} {
- errorMsg N "Close brace not aligned with line\
- [calcLineNo $index] ($tmp $closeBrace)" \
- $closeBraceIx
+# errorMsg N "Close brace not aligned with line\
+# [calcLineNo $index] ($tmp $closeBrace)" \
+# $closeBraceIx
}
}
}
@@ -3626,6 +3680,7 @@
# Make next "E" error visible
proc seeNextError {} {
+
set w $::Nagelfar(resultWin)
set lineNo [lindex [split [$w index insert] .] 0]
@@ -4716,6 +4771,8 @@
editor internal
extensions {.tcl .test .adp .tk}
exitcode 0
+ html 0
+ prefix ""
}
# Do not load anything during test
@@ -4834,6 +4891,8 @@
-encoding <enc> : Read script with this encoding.
-filter <p> : Any message that matches the glob pattern is suppressed.
-severity <level> : Set severity level filter to N/W/E (default N).
+ -html : Generate html-output.
+ -prefix <pref> : Prefix for line anchors (html output)
-novar : Disable variable checking.
-WexprN : Sets expression warning level to N.
2 (def) = Warn about any unbraced expression.
@@ -5042,6 +5101,13 @@
exit
}
}
+ -html {
+ set ::Prefs(html) 1
+ }
+ -prefix {
+ incr i
+ set ::Prefs(prefix) [lindex $argv $i]
+ }
-tab {
incr i
set arg [lindex $argv $i]
@@ -5112,6 +5178,7 @@
}
doCheck
+
#_dumplogme
#if {[array size _stats] > 0} {
# array set _apa [array get _stats]
|
 |
 |
hm2k  | 11-04-2009, 14:00  | |
Member since 10/2009 4 Posts
| Thanks for sharing that.
Do you maintain this version in an open repository?
It would be nice to stay up to date.  |
 |
thommey  | 11-06-2009, 02:27  | Jabber |
(Administrator) Member since 03/2004 62 Posts
| I rarely touch that code, I haven't made any changes to that for almost two years (I just properly generated that patchfile, so I can update nagelfar but still keep my changes). I'll try to remember to change the paste above and post here that I updated it. (So having this thread on your watchlist should do). It's not worth putting that into a CMS   |
 |
hm2k  | 11-06-2009, 15:46  | |
Member since 10/2009 4 Posts
| Thanks.
I have suggested to the author of a possibility of an -eggdrop option using your patch, which would be nice.
Not had a reply yet though.  |
 |
Luminous  | 07-06-2010, 00:53 | I found a bug | |
Member since 07/2010 2 Posts
| Had an interesting experience with the site today... was giving a script to a friend when upon pasting, it reported a missing brace. I was quite sure there was no missing brace, as my script works perfectly, so I spent time tracking it down to the section and discovered it was this regex causing the error: {([[:alnum:]]+)[-./\\]*\1+} What happened, is that the site tried to escape the ] rather than the backslash in that regex. It doesn't see the escape as "\\". I even tried a single \ and it still tried to escape the ]. Adding another ] clears it, but will also break the script if loaded.  |
 |
thommey  | 07-06-2010, 01:28  | Jabber |
(Administrator) Member since 03/2004 62 Posts
| The warning is actually generated by pretty simple code (not even close to what would be required to do that perfectly) and shouldn't even be there anymore, we just disabled it after you report. (the automatic syntaxchecker is way more accurate and replaces the need for that). However, the same bit of code is responsible for colorizing pairs or {} and [] and thanks to your bugreport we fixed that.
The closing ] in the regular expression is now the same as the one before (it used to be black).
Thanks for your detailed report and tracking down this bug!  |
This post was edited 1 times, last on 08-27-2011, 01:22 by thommey
|
 |
Luminous  | 07-06-2010, 22:50  | |
Member since 07/2010 2 Posts
| Not a problem.  Glad it was an easy fix.  |
 |
thommey  | 05-19-2012, 01:24  | Jabber |
(Administrator) Member since 03/2004 62 Posts
| Just a quick FYI:
I attempted to fix the line numbers not aligning properly with the code, depending on operating system + browser combination. While doing that, I also wanted to try out a new font for the code (which should work in all modern browsers, the 0 has a little dot in the middle to distinguish it from the O). Feedback is welcome!  |