Getting Responce From Executed Action

Back to Module Development

Page: 1  
From User Message Body
EHCanadian
Post #911
user avatar
Member
Date: 8:50 am, Feb 2 2009
Posts: 16


Is there a function to capture the servers responce to a action.

Example.

Triger:
!member EHCanadian
Function
$PreUserCMD = "USERHOST ".$line['fromNick'];
$this->ircClass->sendRaw($PreUserCMD,true);

Stuck after that to get the responce. I see the responce in the terminal but nothing is comming to mind on how to obtain the responce from the server

------
Lag is the #1 killer!
Mad_Clog
Post #912
user avatar
Member
Date: 5:49 pm, Feb 2 2009
Posts: 176


You can catch these by using the RAW number.
Say the response number is 345, put the following in your module config

Code
type 345 module function
345 myCustumMod myCustomFunction


EHCanadian
Post #914
user avatar
Member
Date: 7:37 pm, Feb 2 2009
Posts: 16


I Think this make a little more sence :)

Ok.. Well. I was wondering if there/is a pre build function that gets the responce from the server on a sent sendRaw

I see the responce from the terminal window but not sure what function/string I can call to obtain that responce

Rather then build a function for each numeric responce. I want to get the string and explode it myself

------
Lag is the #1 killer!
Mad_Clog
Post #917
user avatar
Member
Date: 5:48 pm, Feb 3 2009
Posts: 176


"Cleanest" way would be to build a function for each response.
Regarding catching all input data, try RAW as the input type
Code
raw yourMod yourFunction


EHCanadian
Post #918
user avatar
Member
Date: 12:25 am, Feb 4 2009
Posts: 16


Kinda lost at what you trying to say..

Code

public function member($line, $args){
     
}


or

Code

class admin extends module {

}


casue I see a function on the irc.php with responce codes however responce 302 isn't located in it

Code

private function parseServerMsgs($cmd)


}




------
Lag is the #1 killer!
EHCanadian
Post #919
user avatar
Member
Date: 5:27 am, Feb 4 2009
Posts: 16


ohhh ok I see what you where talking about.

In order to get a responce from a executed action I was to add a line on my mod config file

modules/groovy/groovy.conf

Code

;Get Numeric Responce
type 302 module function
302 groovy groovyresponce


and in my groovy.php

Code

public function groovyresponce($line){
 //use $line['raw']
}


------
Lag is the #1 killer!
Mad_Clog
Post #921
user avatar
Member
Date: 5:49 pm, Feb 4 2009
Posts: 176


Sounds about right, yes

EHCanadian
Post #926
user avatar
Member
Date: 7:25 am, Feb 5 2009
Posts: 16


A responce like my above post was alot more simpler to understand then a 2 line responce lol. Guess it don't help that I just started using the bot just over 5 days now

Anyhow hope my above post helps someone else out looking to do the same thing on getting server responces not already definded in the source.

------
Lag is the #1 killer!
   

Back to Module Development