mIRC Home    About    Download    Register    News    Help

Print Thread
#47435 05/09/03 04:16 PM
Joined: Sep 2003
Posts: 2
S
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: Sep 2003
Posts: 2
hi i'm just new here because all the other sites for mirc scripting being syn-flood mad

uh well i'll start right away with my question because it ain't a nice problem frown

first my code:

Code:
alias lalign {
  var %a = 1,%b = $calc($window($active).dw - 10),%c = $1,%d = $2-
  while (%a = $wrap(%d,fixedsys,9,%b,0)) {
    echo %c $wrap(%d,fixedsys,9,%b,%a)
    inc %a 
  }
}


and now i use this code by using something like this:

Code:
on ^*:text:*:#:{
  echo $chan $timestamp $nick $lalign($chan,$1-)
  haltdef
}


I'm using this script for a theme i'm making that is using aligned things .. like this

so i also want to align my lines smile

but the problem is:

if i type a long line its not showing....

its only showing the $timestamp and the $nick ... and thats it

if i type a small line it goes like

TIME NICK: <$null>
TIME NICK: the line i typed here..

so its first showing an emtpy line frown

so as you can see its quite a nasty problem, so please help me out with this one smirk

thanks..


w00t
#47436 05/09/03 05:48 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Off hand I would say its because ur use of $lalign is an identifier in the text event, yet you have the lalign do its own seperate echo, and not return anything. Kind of like..

alias a { /echo -s A! }
alias b { /echo -a $a }

That would echo

A!
* /echo: insufficient params

This is because the use of the first alias as an identifier means you want a value returned, not for it to do its own action. I would make it return the first line of the wrap back through $lalign, then have the alias do the echos for lines 2, 3, etc (if need be).


-KingTomato

Link Copied to Clipboard