mIRC Home    About    Download    Register    News    Help

Print Thread
Addons, scripting and all stuff around it;x #21147 27/04/03 02:26 PM
Joined: Apr 2003
Posts: 42
E
eendje Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Apr 2003
Posts: 42
Hello,
Well, I'm Using IRC for about 1/2 year now, And I decided to make some addons, and maybe a whole new script with these addons.
I've been scripting a lot lately and some of my scripts even work.
But Still I meet some porblems, I got multiple little scripts here that I got problems With And I Need some help to solve them, and I got some Non scripting problems, With adding sub menus to the script and stuff, But hopefully this will all clear up in the coming questions, There will also be some images inserted to make some things clear and stuff
Well here we go:

First up:
I've made a little script what should say "I rule XXX peons in XXX channels!" When u write //say $power, And it doesn't work, It just replys a number like 177

u can see a little screenie here what happens
http://members.lycos.nl/bibadi/power.jpg
As you see when i say //say $power you see a number.
But I want the line I rule %j damned crypts (of $chan(0) $+ ) and possess %k cursed souls (of %l $+ ).

This is my code
Code:
  
alias power {
  var %i = 1,%j,%k,%l 
  while ($chan(%i)) {
    if ($me isop $chan(%i)) {
      set %k $calc(%k + $nick($chan(%i),0)) 
      inc %j 
    } 
    set %l $calc(%l + $nick($chan(%i),0)) 
    inc %i 
  } 
  return I rule %j damned crypts (of $chan(0) $+ ) and possess %k cursed souls (of %l $+ ).
}


Then I got another problem;
I made another little script;

Code:
 on *:ACTION:$(* $+ $me $+ *):*: {if (!%action. [ $+ [ $address($nick,2) ] ]) { /describe $target $replace($1-,$me,$nick)}
 


This should, when some1 slaps me, Slap him back with excactly the same line But only his name instead of mine, And sometimes it works and sometimes it doesn't
(practically it must say the same thing as another does when he write a line starting with /me and where my nick is placed in , But he doesn't do that always.

Then I made some slapper script, But i practically don't know how to make a sub menu, (when i click right mouse in a chan) Where i can see it and use them;x
Also for this i have a screenie
Which is located here;
http://members.lycos.nl/bibadi/slaps.gif
As you see I already got some slaps there but they are from the script I use now,
Now I want A New submenu, under the submenu 'slaps' called 'slaps2' (smart heh) Where i can put my own slaps. And offcourse I want it to be there when I put a file In my IRC map;x (so i will not change my remote) (it's an addon).

And I made a script when someone bans me, I should remove the ban, Deop the 1 who did it, and notice myself that I was banned
Code:
on !@*:ban:#:{
if ($banmask iswm $address($me,5)) {
  mode $chan -bo $banmask $nick
  echo -a [ ban ] $nick banned you ( $+ $banmask $+ ) on $chan
}

But I woudn't come here if it didn't work:D
Well, I think That's about it for now,
I hope that someone can solve all my problems, Or atleast 1:)


( By The way: Mind my english;x I'm dutch;x)


---
signatures own
Re: Addons, scripting and all stuff around it;x #21148 27/04/03 04:22 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Okay first off, I have no problems with echo or saying $power.. i.e.



Secondly, the action text is a little sloppy.. I copy and pasted exactly, and the editor shoved everything below it over. All i did was space out your braces, making sure they don't touch anything, and it seems to work fine.

Code:
on *:ACTION:$(* $+ $me $+ *):*: { if (!%action. [ $+ [ $address($nick,2) ] ]) { /describe $target $replace($1-,$me,$nick) } }


or to be even neater (in my opinion), use..

Code:
on *:ACTION:$(* $+ $me $+ *):*: {
  if (!%action. [ $+ [ $address($nick,2) ] ]) {
    /describe $target $replace($1-,$me,$nick)
  }
}



Thirdly, as for the ban script. From off hand, just an immidate look without further testing, I noticed a missing brace. I believe, you should be able to add a brace to the end, and everything should be fine.

Code:
on !@*:ban:#:{
  if ($banmask iswm $address($me,5)) {
    mode $chan -bo $banmask $nick
    echo -a [ ban ] $nick banned you ( $+ $banmask $+ ) on $chan
  }
[color:Red]}[/color]


If there is anything, just let me know. grin


-KingTomato
Re: Addons, scripting and all stuff around it;x #21149 28/04/03 12:25 AM
Joined: Dec 2002
Posts: 699
N
Nimue Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
You might want to change that on action a little
Code:
on *:ACTION:$($+(*,$me,*)):*:{
  if !%action. [ $+ [ $site ] ] {
    ; Check if $target is a channel or <You>
    if $target ischan { describe $target $replace($1-,$me,$nick) }
    else { describe $nick $replace($1-,$me,$nick) }
  }
  ; Prevent slapping frenzies if user had some similar script.
  inc -u30 %action. $+ $site
}
Add your popups by putting them into a new script file (Alt+A > File menu > New)
Code:
menu nicklist,query {
 .Slaps2
 ..one:echo -a your slap #1 goes here
 ..two:echo -a your slap #2 goes here
 ..three:echo -a your slap #3 goes here
}

Re: Addons, scripting and all stuff around it;x #21150 28/04/03 08:37 AM
Joined: Apr 2003
Posts: 42
E
eendje Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Apr 2003
Posts: 42
wel, yes there is a problem
//echo $power | /say $power
Then my script says
* /echo: insufficient parameters


---
signatures own
Re: Addons, scripting and all stuff around it;x #21151 28/04/03 12:59 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Thats strange. What version of mirc are you running? I have 6.03 and the double execute works perfectly fine.. If you want to try it stil, just revise it so that $power is not the only thing being displayed. Ex:

//echo Power: $power | /say Power: $power

That will work, I'm pretty confidant. grin


-KingTomato
Re: Addons, scripting and all stuff around it;x #21152 28/04/03 01:00 PM
Joined: Dec 2002
Posts: 1,527
_
_D3m0n_ Offline
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
most likely because of power script writting ....... or poor usage of an alias identifer uve made ...... or, $power isnt an identifier in mirc that i have seen. if u try using an identifier that doesnt exist of course there is going to be an error


D3m0nnet.com
Re: Addons, scripting and all stuff around it;x #21153 28/04/03 01:02 PM
Joined: Dec 2002
Posts: 1,527
_
_D3m0n_ Offline
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
also king keep in mind to use an identifier u ned to use //say instead of /say


D3m0nnet.com
Re: Addons, scripting and all stuff around it;x #21154 28/04/03 02:38 PM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021
He took care of the // at the beginning of the line .. and actually, the SAY didn't need a slash at all.

Re: Addons, scripting and all stuff around it;x #21155 28/04/03 02:41 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
That is correct. If you prefic the first statement with double slashes, everything after it, including after a pipe, can be treated like it's in remotes. grin


-KingTomato
Re: Addons, scripting and all stuff around it;x #21156 28/04/03 03:19 PM
Joined: Dec 2002
Posts: 699
N
Nimue Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Type //echo -a $isalias(power) : $isalias(power).fname
Check the filename is the same as the one for this script, you may have another 'power' alias which requires some parameters.

Re: Addons, scripting and all stuff around it;x #21157 28/04/03 03:26 PM
Joined: Apr 2003
Posts: 42
E
eendje Offline OP
Ameglian cow
OP Offline
Ameglian cow
E
Joined: Apr 2003
Posts: 42
Well, I just changed the alias from $power to $power2 and it worked;x


---
signatures own
Re: Addons, scripting and all stuff around it;x #21158 28/04/03 03:30 PM
Joined: Dec 2002
Posts: 699
N
Nimue Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Good :[/b])

Re: Addons, scripting and all stuff around it;x #21159 10/06/03 10:20 PM
Joined: Jun 2003
Posts: 5
J
jejeje Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
J
Joined: Jun 2003
Posts: 5
Hi im new to scripting, dunno much about it actually, but I want to learn. How would I set a counter slap that would say something like:
<Example> Example slaps jejeje with a large trout
<jejeje>counter Example's slap with a rusty old bucket

Re: Addons, scripting and all stuff around it;x #21160 10/06/03 11:13 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
on 1:ACTION:$(*slap* $+ $me $+ *):#: {
/describe $chan slaps $nick with a rusty old bucket.
}


-KingTomato
Re: Addons, scripting and all stuff around it;x #21161 11/06/03 05:09 AM
Joined: Jun 2003
Posts: 5
J
jejeje Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
J
Joined: Jun 2003
Posts: 5
I meant something other than slap. The script works btw, but what do I insert to make the countering code other than slap.
i.e. rather than slap, there's punch, poke, spit, etc.

Re: Addons, scripting and all stuff around it;x #21162 11/06/03 07:18 AM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
this is what i use:

Code:
[color:green]
; -------------------------------------------------------------------------------------------------
; Anti-Action
[/color]
on 1:ACTION:$(* $+ $me $+ *):#: {
  var %a = 1, %keys = [color:red]slap smack trout shoot hit oozy gun[/color]
  while (%a &lt;= $numtok(%keys, 32)) {
    if (($gettok(%keys, %a, 32) isin $1-) &amp;&amp; ($me isop $chan)) {
      /inc -u5 %slap. [ $+ [ $nick ] ]
      if (%slap. [ $+ [ $nick ] ] &lt; 3) /describe $chan [color:Red]slaps $nick with an old rusty bucket.[/color]
      return
    }
    /inc %a
  }
}


The first red portion is the "triggers" i.e. youd add poke, spit, punch, etc. The second is the responce made back at the user.


-KingTomato
Re: Addons, scripting and all stuff around it;x #21163 11/06/03 08:43 AM
Joined: Jun 2003
Posts: 5
J
jejeje Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
J
Joined: Jun 2003
Posts: 5
thank you so much =D

Re: Addons, scripting and all stuff around it;x #21164 11/06/03 06:15 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
np glad to help >:D


-KingTomato